Anonymous avatar 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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.