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

(Linux) Process.open_files can return file position and mode and flags #777

Closed
giampaolo opened this issue Feb 27, 2016 · 1 comment
Closed

Comments

@giampaolo
Copy link
Owner

...thanks to /proc/pid/fdinfo we can determine those as well: https://lwn.net/Articles/268728/
File position is easy to get. As for file mode, fdinfo file provides a flags octal number which can be converted with int(flags, 8). We need to convert that number by using O_* flags (os.O_RDONLY, os.O_WRONLY, os.O_RDWR, os.O_APPEND, ...) and turn that into a human readable mode string ("r", "w", "a", etc.).

@giampaolo
Copy link
Owner Author

Imeplemented in #778.

@giampaolo giampaolo changed the title (Linux) Process.open_files can return file position and mode (Linux) Process.open_files can return file position and mode and flags Feb 27, 2016
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