You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, psutil_get_open_files returns a list of file names in a raw format such as:
\Device\HarddiskVolume1\Windows\systemew\file.txt
However for a network file, the raw format looks like this:
\Device\Mup\sharename\path\to\file.txt
These filenames are split to take the first 2 items "\Device\HarddiskVolume1" or "\Device\Mup" and passed to QueryDosDevice.
If QueryDosDevice fails, it just returns blank and the following call to isfile_strict will fail so the filename will not return.
There are 2 cases to consider:
1 - The network drive is mapped to a drive letter e.g. Z:\path\to\file.txt
2 - The network drive is not mapped: \sharename\path\to\file.txt
The text was updated successfully, but these errors were encountered:
I can reproduce the issue by putting psutil GIT cloned directory in a shared folder (Z:\) and I see exactly the behavior you describe. In my case the file looks like "\VBOXSVR\psutil\file".
That kind of path is not usable by python (e.g. open() won't work). We would need the actual drive letter to which it is mapped, something like "Z:\VBOXSVR\psutil\file", but I'm not sure how to do that (QueryDosDevice does not resolve it).
On Windows, psutil_get_open_files returns a list of file names in a raw format such as:
\Device\HarddiskVolume1\Windows\systemew\file.txt
However for a network file, the raw format looks like this:
\Device\Mup\sharename\path\to\file.txt
These filenames are split to take the first 2 items "\Device\HarddiskVolume1" or "\Device\Mup" and passed to QueryDosDevice.
If QueryDosDevice fails, it just returns blank and the following call to isfile_strict will fail so the filename will not return.
There are 2 cases to consider:
1 - The network drive is mapped to a drive letter e.g. Z:\path\to\file.txt
2 - The network drive is not mapped: \sharename\path\to\file.txt
The text was updated successfully, but these errors were encountered: