New submission from Eryk Sun <eryk...@gmail.com>:

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

----------
components: Extension Modules, Windows
messages: 411516
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] wrap CreateFile to support follow_symlinks
type: enhancement

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

Reply via email to