[Scummvm-git-logs] scummvm-web master -> ebeebc2193b960542dcc6e9b2a4f6aebee77ab67
lephilousophe
noreply at scummvm.org
Sun Sep 21 18:11:38 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://api.github.com/repos/scummvm/scummvm-web .
Summary:
ebeebc2193 DUMPER-COMPANION: Also dump the dates from HFS
Commit: ebeebc2193b960542dcc6e9b2a4f6aebee77ab67
https://github.com/scummvm/scummvm-web/commit/ebeebc2193b960542dcc6e9b2a4f6aebee77ab67
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-09-21T20:09:59+02:00
Commit Message:
DUMPER-COMPANION: Also dump the dates from HFS
Changed paths:
dumper-companion/src/hfs/directory.ts
dumper-companion/src/hfs/main.ts
diff --git a/dumper-companion/src/hfs/directory.ts b/dumper-companion/src/hfs/directory.ts
index 6a43cf82..70f20fb9 100644
--- a/dumper-companion/src/hfs/directory.ts
+++ b/dumper-companion/src/hfs/directory.ts
@@ -41,6 +41,10 @@ export class AbstractFolder {
_namedict: {[key: string]: Uint8Array};
_maindict: {[name: string]: FileOrFolder};
+ crdate: number;
+ mddate: number;
+ bkdate: number;
+
constructor() {
this._namedict = {}; // key string to raw name
this._maindict = {}; // key string to contents
@@ -86,28 +90,37 @@ export class AbstractFolder {
return res;
}
- dumpToZip(zipDir: ZipDirectoryEntry, lang: Language, puny: boolean, forceMacBinary: boolean, log: (string) => void): void {
+ dumpToZip(zipDir: ZipDirectoryEntry, lang: Language, puny: boolean, forceMacBinary: boolean, log: (string) => void): ZipDirectoryEntry {
for (const [name, child] of this.items()) {
const encodedName = encodeFileName(name, lang, puny, log);
if (child instanceof AbstractFolder) {
- child.dumpToZip(zipDir.addDirectory(encodedName), lang, puny, forceMacBinary, log);
+ child.dumpToZip(zipDir.addDirectory(encodedName, {
+ lastModDate: hfs_ts_to_date(child.mddate),
+ }), lang, puny, forceMacBinary, log);
} else {
- zipDir.addUint8Array(encodedName, forceMacBinary ? child.toMacBinary(name) : child.toBinary(name));
+ zipDir.addUint8Array(encodedName, forceMacBinary ? child.toMacBinary(name) : child.toBinary(name), {
+ lastModDate: hfs_ts_to_date(child.mddate),
+ });
}
}
+ return zipDir;
}
}
+function hfs_ts_to_date(hfs_ts) {
+ const HFS_UTC_OFFSET = 2082844800;
+ if (!hfs_ts) {
+ return new Date();
+ }
+ return new Date((hfs_ts - HFS_UTC_OFFSET) * 1000);
+}
+
export class MacFolder extends AbstractFolder {
flags: number;
x: number;
y: number;
- crdate: number;
- mddate: number;
- bkdate: number;
-
constructor() {
super();
diff --git a/dumper-companion/src/hfs/main.ts b/dumper-companion/src/hfs/main.ts
index 23a37f2d..5ed2b184 100644
--- a/dumper-companion/src/hfs/main.ts
+++ b/dumper-companion/src/hfs/main.ts
@@ -58,9 +58,6 @@ function _get_every_extent(nblocks: number, firstrecord: Uint8Array, cnid: numbe
export class Volume extends AbstractFolder {
- crdate: number;
- mddate: number;
- bkdate: number;
name: string;
constructor() {
More information about the Scummvm-git-logs
mailing list