Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: FileInfo.Sys should return underlying data source on Windows #9611
The documentation of the Sys method for the FileInfo interface says:
However the Windows implementation does not do this.
The underlying data source for the FileInfo implementation in the Stat function is
The underlying data source for the FileInfo implementation in the Readdir method is syscall.Win32finddata, however the Sys method returns syscall.Win32FleAttributeData.
The advantage of the current implementation is that Sys returns the same dynamic type, as it is done on Unix systems. However the disadvantage is that some valuable information (VolumeInformation and FineIndex from the Stat call) is thrown away. The current implementation also has to allocate additional space.
Since the interface documentation seems to allow it, I propose that the Sys method returns the actual underlying data used by the implementation, ad discussed above.
The change does not break the go 1 compatibility promise.
I don't think we should be making this change. We don't want to break people's code. Closing this as "unfortunate".
https://groups.google.com/forum/#!topic/golang-dev/Kky-9-TrcWY for full discussion.
On Sun, Jan 18, 2015 at 6:43 AM, alexbrainman firstname.lastname@example.org
It's unfortunate, since this is a private API and the go fix tool should be