Commits

Anonymous committed 1a869c9

os.FileInfo fixups for go-weekly.2011-12-02

Comments (0)

Files changed (1)

 	hdr := &tar.Header{
 		Name:     root_name,
 		Mode:     int64(492),
-		Uid:      fi.Uid,
-		Gid:      fi.Gid,
+		//Uid:      fi.Uid,
+		//Gid:      fi.Gid,
 		Size:     0,
 		Typeflag: tar.TypeDir,
-		Mtime:    fi.Mtime_ns / 1e9, // ns to s
-		Atime:    fi.Atime_ns / 1e9,
-		Ctime:    fi.Ctime_ns / 1e9,
+		//Mtime:    fi.Mtime_ns / 1e9, // ns to s
+		//Atime:    fi.Atime_ns / 1e9,
+		//Ctime:    fi.Ctime_ns / 1e9,
 	}
 
 	err = tw.WriteHeader(hdr)
 		}
 		hdr := &tar.Header{
 			Name:     filepath.Join(root_name, filepath.Base(fd.Name())),
-			Mode:     int64(fi.Permission()),
-			Uid:      stats.Uid,
-			Gid:      stats.Gid,
-			Size:     stats.Size,
+			Mode:     int64(fi.Mode()),
+			//Uid:      stats.Uid,
+			//Gid:      stats.Gid,
+			Size:     stats.Size(),
 			Typeflag: tar.TypeReg,
-			Mtime:    stats.Mtime_ns / 1e9, // to seconds
-			Atime:    stats.Atime_ns / 1e9, // to seconds
-			Ctime:    stats.Ctime_ns / 1e9, // to seconds
+			ModTime:  stats.ModTime(),
+			//Atime:    stats.Atime_ns / 1e9, // to seconds
+			//Ctime:    stats.Ctime_ns / 1e9, // to seconds
 		}
 		//println("-->",hdr.Name,hdr.Size)
 		err = tw.WriteHeader(hdr)