mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-09-05 16:47:31 -04:00
Merge pull request #88 from jiria/fileattributes_size
Update FileAttributes size to work across all platforms
This commit is contained in:
+1
-1
@@ -303,7 +303,7 @@ func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *win
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, nil, err
|
return "", 0, nil, err
|
||||||
}
|
}
|
||||||
fileInfo.FileAttributes = uintptr(attr)
|
fileInfo.FileAttributes = uint32(attr)
|
||||||
} else {
|
} else {
|
||||||
if hdr.Typeflag == tar.TypeDir {
|
if hdr.Typeflag == tar.TypeDir {
|
||||||
fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY
|
fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY
|
||||||
|
|||||||
+2
-1
@@ -20,7 +20,8 @@ const (
|
|||||||
// FileBasicInfo contains file access time and file attributes information.
|
// FileBasicInfo contains file access time and file attributes information.
|
||||||
type FileBasicInfo struct {
|
type FileBasicInfo struct {
|
||||||
CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime
|
CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime
|
||||||
FileAttributes uintptr // includes padding
|
FileAttributes uint32
|
||||||
|
pad uint32 // padding
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFileBasicInfo retrieves times and attributes for a file.
|
// GetFileBasicInfo retrieves times and attributes for a file.
|
||||||
|
|||||||
Reference in New Issue
Block a user