Python Forum
code i would lik to see
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code i would lik to see
#1
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).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Why don't take all mounted devices and check the path against the mounted point of each of them?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
(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?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020