@@ -385,7 +385,7 @@ of the file or directory `src` refers to.
385
385
Return `dst`.
386
386
387
387
!!! note
388
- The `cp` function is different from the `cp` command. The `cp` function always operates on
388
+ The `cp` function is different from the `cp` Unix command. The `cp` function always operates on
389
389
the assumption that `dst` is a file, while the command does different things depending
390
390
on whether `dst` is a directory or a file.
391
391
Using `force=true` when `dst` is a directory will result in loss of all the contents present
@@ -438,6 +438,16 @@ julia> mv("hello.txt", "goodbye.txt", force=true)
438
438
julia> rm("goodbye.txt");
439
439
440
440
```
441
+
442
+ !!! note
443
+ The `mv` function is different from the `mv` Unix command. The `mv` function by
444
+ default will error if `dst` exists, while the command will delete
445
+ an existing `dst` file by default.
446
+ Also the `mv` function always operates on
447
+ the assumption that `dst` is a file, while the command does different things depending
448
+ on whether `dst` is a directory or a file.
449
+ Using `force=true` when `dst` is a directory will result in loss of all the contents present
450
+ in the `dst` directory, and `dst` will become a file that has the contents of `src` instead.
441
451
"""
442
452
function mv (src:: AbstractString , dst:: AbstractString ; force:: Bool = false )
443
453
if force
@@ -1192,6 +1202,8 @@ If a path contains a "\\0" throw an `ArgumentError`.
1192
1202
On other failures throw an `IOError`.
1193
1203
Return `newpath`.
1194
1204
1205
+ This is a lower level filesystem operation used to implement [`mv`](@ref).
1206
+
1195
1207
OS-specific restrictions may apply when `oldpath` and `newpath` are in different directories.
1196
1208
1197
1209
Currently there are a few differences in behavior on Windows which may be resolved in a future release.
@@ -1202,6 +1214,9 @@ Specifically, currently on Windows:
1202
1214
4. `rename` may remove `oldpath` if it is a hardlink to `newpath`.
1203
1215
1204
1216
See also: [`mv`](@ref).
1217
+
1218
+ !!! compat "Julia 1.12"
1219
+ This method was made public in Julia 1.12.
1205
1220
"""
1206
1221
function rename (oldpath:: AbstractString , newpath:: AbstractString )
1207
1222
err = ccall (:jl_fs_rename , Int32, (Cstring, Cstring), oldpath, newpath)
0 commit comments