Python Forum

Full Version: code i would lik to see
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i would like to see (and maybe steal) code that takes a POSIX file path and determines the mount point of the file system it is in. my first thought of logic is to step through parent directories until the next parent is a different file system. my big concern for this is if this is a bind mount, in which case logic won't yield the true file system mount point but will yield the bind mount point.

but maybe mount point is not what i want. i am writing code to move file to a "junk" directory. but the user home tree may have more than one file system and moves between file systems cannot be done as straight moves. so the idea is that there would be a "junk" directory in each writable file system under that user's file writable (deletable) file trees.

this junk command will create the junk directory if either it is needed to move one or more files to it or the "-c" (create) option is specified. the "-f" (flush) optionwill remove the directory (and everything in it).
Why don't take all mounted devices and check the path against the mounted point of each of them?
(Apr-10-2018, 05:49 AM)wavic Wrote: [ -> ]Why don't take all mounted devices and check the path against the mounted point of each of them?
if 2 of them match the path, then what?