cpp file I'm working with creates a directory, i.e.
mkdir( path, ... ), where path comes from an environment variable (e.g.
getenv( "FOO" );).
As an example, say
path, created above, is `/foo/newPath/'.
For my question scenario, it is possible that
/foo/oldPath/ exists and has content (assume no further subdirectories), in which case I want to move files from
My question is: because
/foo/newPath/ is created as a subdirectory of
/foo/oldPath/ have the same parent directory, is it then guaranteed that both directories are on the same "mounted file system"? My understanding of mount points and file systems on Linux is tenuous at best.
The context behind this question is: if
/foo/oldPath/ are guaranteed to be on the same mounted file system, I can use
rename() to more easily perform the file movement than other alternatives. The man page of the function says that it will fail if
newPath are not on the same "mounted file system."