Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 382 by
furlo...@gmail.com: get_open_files does not include open
files that have been deleted
http://code.google.com/p/psutil/issues/detail?id=382
What steps will reproduce the problem?
>>> p = psutil.Process(25002)
>>> ofiles = p.get_open_files()
ofiles does not contain all files that are opened for this process.
What is the expected output?
ofiles should contain all files that this process has opened (deleted or
not).
What do you see instead?
Only open files that exist are included.
What version of psutil are you using? What Python version?
# python --version
Python 2.7.3
python-psutil_0.7.0-1_amd64.deb
On what operating system? Is it 32bit or 64bit version?
64bit
Please provide any additional information below.
Processes can have open files that have since been deleted and these are
not included in get_open_files. It would be useful if get_open_files could
be passed a variable with the option to include these files, as what is
currently returned does not match the list of open files that e.g. lsof
returns.
For example, this would be useful for determining which services need to be
restarted due to deleted files after package upgrades. Specifically, I was
attempting to rewrite the "checkrestart"[1] command using psutil instead of
lsof. It would greatly simplify the program if this functionality was
present in psutil.
[1]
http://anonscm.debian.org/gitweb/?p=collab-maint/debian-goodies.git;a=blob;f=checkrestart;h=6caaf109ba3a6ac764239fea01ddbc0425a6496d;hb=a8607224f80ac6630f358dc6b5bd9f1897e68896
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings