Remove updateTimes because I was running into integer overlow issues.

This commit is contained in:
Caleb J. Gardner
2026-02-07 06:42:34 -06:00
parent bcfd983f8d
commit 704215e1a9
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -4,4 +4,4 @@ This is my experiments to learn Zig. Might amount to something. Might not.
## Current State
Kinda works as a library, but currently has known memory leaks. `unsquashfs` is missing a lot of features (and will probably never match the official unsquashfs). Extraction is stupidly slow and uses too many resources. Only properly work on Linux, any other OSes probably won't work fully.
Overall works, but currently is completely single threaded and is missing some features. Extraction is slow. Only properly work on Linux, any other OSes probably won't work fully.
+4 -2
View File
@@ -221,7 +221,8 @@ fn extractRegFile(self: Inode, archive: *Archive, path: []const u8, options: Ext
_ = try dat_rdr.interface.streamRemaining(&wrt.interface);
try wrt.interface.flush();
// updateTime is in nanoseconds (a billionth of a second). mod_time is in seconds.
try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time);
// TODO: fix
// try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time);
if (!options.ignore_permissions) {
try fil.chmod(self.hdr.permissions);
try fil.chown(try archive.id(self.hdr.uid_idx), try archive.id(self.hdr.gid_idx));
@@ -305,7 +306,8 @@ fn extractDevice(self: Inode, archive: *Archive, path: []const u8, options: Extr
}
var fil = try std.fs.cwd().openFile(path, .{});
// updateTime is in nanoseconds (a billionth of a second). mod_time is in seconds.
try fil.updateTimes(self.hdr.mod_time * (10 ^ 9), self.hdr.mod_time * (10 ^ 9));
// TODO: fix
// try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time);
if (!options.ignore_permissions) {
try fil.chmod(self.hdr.permissions);
try fil.chown(try archive.id(self.hdr.uid_idx), try archive.id(self.hdr.gid_idx));