Skip to content

Commit

Permalink
Revert "Implement winio.GetFileStandardInfo"
Browse files Browse the repository at this point in the history
This reverts commit ef753e6.

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
  • Loading branch information
katiewasnothere committed Apr 21, 2021
1 parent d80ed10 commit e5bd3f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 153 deletions.
19 changes: 0 additions & 19 deletions fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,6 @@ func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error {
return nil
}

// FileStandardInfo contains extended information for the file.
// FILE_STANDARD_INFO in WinBase.h
// https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_standard_info
type FileStandardInfo struct {
AllocationSize, EndOfFile int64
NumberOfLinks uint32
DeletePending, Directory bool
}

// GetFileStandardInfo retrieves ended information for the file.
func GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) {
si := &FileStandardInfo{}
if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), windows.FileStandardInfo, (*byte)(unsafe.Pointer(si)), uint32(unsafe.Sizeof(*si))); err != nil {
return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err}
}
runtime.KeepAlive(f)
return si, nil
}

// FileIDInfo contains the volume serial number and file ID for a file. This pair should be
// unique on a system.
type FileIDInfo struct {
Expand Down
134 changes: 0 additions & 134 deletions fileinfo_test.go

This file was deleted.

0 comments on commit e5bd3f6

Please sign in to comment.