Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mount options support to disk_partitions #209

Closed
giampaolo opened this issue May 23, 2014 · 9 comments
Closed

Add mount options support to disk_partitions #209

giampaolo opened this issue May 23, 2014 · 9 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on September 16, 2011 21:53:15

psutil.get_parititions() is very useful, but it doesn't tell you if the 
filesystem is read-only, which is available from the mount options.  This is 
available via the mntent structure, but it's not piped through all the way to 
the python tuples.

This feature request is for adding support to read filesystem options.

Thanks!

Original issue: http://code.google.com/p/psutil/issues/detail?id=209

@giampaolo
Copy link
Owner Author

From g.rodola on September 19, 2011 11:23:50

Those options are not standardized, therefore I can't think of a consistent API 
to provide them all.
Some examples:

rw,mode=0755
rw,noexec,nosuid,gid=5,mode=0620
rw,nosuid,nodev,user=giampaolo
rw,nosuid,nodev,allow_other,blksize=4096,default_permissions

Maybe you meant to provide permissions only ('r', 'w', 'rw')?

Labels: -Type-Defect Type-Enhancement

@giampaolo
Copy link
Owner Author

From [email protected] on September 19, 2011 11:30:01

I just need permissions in my case, but even if they're not standardized, 
they're always a list of strings, with their meaning depending on the 
filesystem type.

@giampaolo
Copy link
Owner Author

From g.rodola on October 22, 2011 04:50:38

Status: WaitingForReview
Labels: OpSys-UNIX

@giampaolo
Copy link
Owner Author

From g.rodola on April 19, 2012 12:02:21

Looking back at this I think it's a nice idea to provide the raw option string 
because despite not being standardized it's very easy to parse.
By using your use case as an example, one might do:

>>> read_only = 'rw' not in opts.split(',')

I'll see what we can do on Windows.
If we're able to determine partition permissions we can at least return "r" or 
"rw" to emulate the UNIX behavior. If we can't we'll just return an empty string.

Status: Accepted
Labels: Milestone-0.5.0

@giampaolo
Copy link
Owner Author

From g.rodola on April 20, 2012 08:13:02

Linux and FreeBSD implementation committed as r1288 and r1289 .

Status: Started
Labels: Progress-2in4

@giampaolo
Copy link
Owner Author

From g.rodola on April 20, 2012 08:53:37

OSX implementation committed in r1290 .

Labels: -Progress-2in4 Progress-3in4

@giampaolo
Copy link
Owner Author

From g.rodola on May 04, 2012 11:12:51

Windows implementation committed as r1306 .
"fstype" now reflects the real filesystem type (e.g. "NTFS", "FAT") and 
"options" field is filled with drive permissions ("rw" or "ro") and drive type 
("fixed", "removable", "cdrom", etc...) as a comma separated string.

Status: FixedInSVN
Labels: -OpSys-UNIX -Progress-3in4 Progress-4in4

@giampaolo
Copy link
Owner Author

From g.rodola on June 27, 2012 11:54:03

0.5.0 is finally out. Closing out as fixed.

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 04:03:41

Updated csets after the SVN -> Mercurial migration: r1288 == revision 
529a8c73abb9 r1290 == revision fed730fd4549 r1306 == revision d635682f575f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant