This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2022-01-24.21:24:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org>
In-reply-to
Content
Issue 46490 proposes to support follow_symlinks in os.utime() on Windows. Instead of duplicating the os.stat() implementation of follow_symlinks, I suggest factoring out a common _Py_CreateFile() function with two additional parameters: traverse (input) and pFileInfo (output).

The `traverse` parameter would indicate whether to traverse or open a name-surrogate reparse point. However, FILE_FLAG_OPEN_REPARSE_POINT should take precedence over `traverse` and open any type of reparse point.

The pFileInfo parameter would be an optional pointer to a struct that receives the file type (disk, char, pipe), file attributes, and reparse tag. Querying this information is required when `traverse` is false. There may as well be a way to return it.

Since Windows 7 hasn't been supported since 3.8, this is also an opportunity to switch to the newer CreateFile2() function [1], which is required in order to use new file flags added to the API such as FILE_FLAG_OPEN_REQUIRING_OPLOCK. 

---
[1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2
History
Date User Action Args
2022-01-24 21:24:30eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower
2022-01-24 21:24:30eryksunsetmessageid: <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org>
2022-01-24 21:24:30eryksunlinkissue46506 messages
2022-01-24 21:24:29eryksuncreate