From 350b9857debe74427188ffa973b14e4abce8b0a0 Mon Sep 17 00:00:00 2001 From: Jiri Appl Date: Thu, 2 Aug 2018 10:42:57 -0700 Subject: [PATCH 1/2] Update FileAttributes size to work on 32 bit platforms --- backuptar/tar.go | 2 +- fileinfo.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backuptar/tar.go b/backuptar/tar.go index 53da908f..a2fdf7b7 100644 --- a/backuptar/tar.go +++ b/backuptar/tar.go @@ -303,7 +303,7 @@ func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *win if err != nil { return "", 0, nil, err } - fileInfo.FileAttributes = uintptr(attr) + fileInfo.FileAttributes = attr } else { if hdr.Typeflag == tar.TypeDir { fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY diff --git a/fileinfo.go b/fileinfo.go index b1d60abb..40828d4f 100644 --- a/fileinfo.go +++ b/fileinfo.go @@ -20,7 +20,7 @@ const ( // FileBasicInfo contains file access time and file attributes information. type FileBasicInfo struct { CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime - FileAttributes uintptr // includes padding + FileAttributes uint64 // includes padding } // GetFileBasicInfo retrieves times and attributes for a file. From 5380df2ba598b793614575abab8a403d3ebbc860 Mon Sep 17 00:00:00 2001 From: Jiri Appl Date: Fri, 3 Aug 2018 12:01:41 -0700 Subject: [PATCH 2/2] Changes based on PR --- backuptar/tar.go | 2 +- fileinfo.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backuptar/tar.go b/backuptar/tar.go index a2fdf7b7..d6566dbf 100644 --- a/backuptar/tar.go +++ b/backuptar/tar.go @@ -303,7 +303,7 @@ func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *win if err != nil { return "", 0, nil, err } - fileInfo.FileAttributes = attr + fileInfo.FileAttributes = uint32(attr) } else { if hdr.Typeflag == tar.TypeDir { fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY diff --git a/fileinfo.go b/fileinfo.go index 40828d4f..ada2fbab 100644 --- a/fileinfo.go +++ b/fileinfo.go @@ -20,7 +20,8 @@ const ( // FileBasicInfo contains file access time and file attributes information. type FileBasicInfo struct { CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime - FileAttributes uint64 // includes padding + FileAttributes uint32 + pad uint32 // padding } // GetFileBasicInfo retrieves times and attributes for a file.