Message411516
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 |
|
Date |
User |
Action |
Args |
2022-01-24 21:24:30 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower |
2022-01-24 21:24:30 | eryksun | set | messageid: <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org> |
2022-01-24 21:24:30 | eryksun | link | issue46506 messages |
2022-01-24 21:24:29 | eryksun | create | |
|