STINNER Victor added the comment:

I don't know the physical disk type on Windows. Can you read and write from 
such "file" type? If no, I don't think that it makes sense to support it in 
io.FileIO. What do you think?

It looks like the file must be opened with specific options, otherwise it 
doesn't work. See this question on CreateFile():
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/fa2175fe-02f4-4adb-9cb9-5df3d1122cf6/readfile-works-when-handle-opened-with-drive-letterphysical-drive-symlink-but-not-with-device-path


io.FileIO() calls _Py_fstat() for two reasons:

1) raise an error if the path/file descriptor is a directory
2) get the block size

_Py_fstat() is implemented with two Windows calls: GetFileType() & 
GetFileInformationByHandle().

To solve this issue, we need to have a function telling that the path/file 
descriptor is a physical disk. In this case, we can skip both checks.

Documentation on Physical Drivers in CreateFile():
https://msdn.microsoft.com/en-us/library/aa363858%28VS.85%29.aspx#physical_disks_and_volumes

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25639>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to