Proposal Details
Windows applications might need to know the reparse point tag of a given os.FileInfo. Although the Windows implementation of os.FileInfo knows the reparse point tag, there is no way to get that information using the public os API. This means that applications are forced to partially reimplement os.Lstat by opening the file and calling GetFileInformationByHandleEx.
I propose to add the following helper function to the os package:
// ReparsePointTag returns the the reparse point tag associated with fi.
//
// ReparsePointTag only applies to results returned by this package's [LStat].
// fi must be associated with a reparse point.
// Otherwise, ReparsePointTag returns false.
func ReparsePointTag(fi FileInfo) (uint32, bool)
The ReparsePointTag implementation could be made more os-agnostic by also defining an interface that external os.FileInfo implementations could implement to get the reparse point tag. This might be an overkill for now, as reparse points are not a broadly-addopted concept outside NTFS file systems.
ReparsePointTag would only be useful on Windows for now, although it could potentially be implemented on other OSes supporting NTFS drivers.
@golang/windows
Proposal Details
Windows applications might need to know the reparse point tag of a given
os.FileInfo. Although the Windows implementation ofos.FileInfoknows the reparse point tag, there is no way to get that information using the publicosAPI. This means that applications are forced to partially reimplementos.Lstatby opening the file and callingGetFileInformationByHandleEx.I propose to add the following helper function to the
ospackage:The
ReparsePointTagimplementation could be made moreos-agnostic by also defining an interface that externalos.FileInfoimplementations could implement to get the reparse point tag. This might be an overkill for now, as reparse points are not a broadly-addopted concept outside NTFS file systems.ReparsePointTagwould only be useful on Windows for now, although it could potentially be implemented on other OSes supporting NTFS drivers.@golang/windows