Add note about filesystems to fs::rename#25128
Conversation
src/libstd/fs.rs
Outdated
There was a problem hiding this comment.
Technically, on linux, this will not work across mount points even if the filesystems are the same.
There was a problem hiding this comment.
@Stebalien by "filesystems are the same", is ext4 an example of a filesystem?
There was a problem hiding this comment.
Filesystem as used in this comment (i.e. partition?)
There was a problem hiding this comment.
In that you can have multiple mount points in the same partition?
There was a problem hiding this comment.
I believe that depends on the filesystem. The trivial example is bind mount which lets you mount a directory:
mkdir /path/to/a
mkdir /path/to/b
mount -o bind /path/to/a /path/to/bThese both have the same filesystem (the directory /path/to/a) but different mount points. See the EXDEV comment in man 2 rename (on linux).
There was a problem hiding this comment.
Yeah, filesystem is rather ambiguous. Maybe @steveklabnik should simply say mount point?
There was a problem hiding this comment.
In this case, filesystem is incorrect on linux (both interpretations) HOWEVER, on reading the windows spec, I get the impression that you can rename files between mount points (you can mount drives in folders: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365733%28v=vs.85%29.aspx) as long as they refer to the same underlying filesystem (partition).
|
@bors: rollup |
Fixes #24816
r? @alexcrichton