diff --git a/src/ZipFS.ts b/src/ZipFS.ts index bbfff17..8d7ef7b 100644 --- a/src/ZipFS.ts +++ b/src/ZipFS.ts @@ -1,5 +1,6 @@ -import { FileType, NoSyncFile, Stats, flagToMode, isWriteable, type Cred } from '@zenfs/core'; +import { NoSyncFile, Stats, flagToMode, isWriteable, type Cred } from '@zenfs/core'; import { type Backend } from '@zenfs/core/backends/backend.js'; +import { S_IFDIR } from '@zenfs/core/emulation/constants.js'; import { parse } from '@zenfs/core/emulation/path.js'; import { Errno, ErrnoError } from '@zenfs/core/error.js'; import { FileSystem, Readonly, Sync, type FileSystemMetadata } from '@zenfs/core/filesystem.js'; @@ -155,7 +156,7 @@ export class ZipFS extends Readonly(Sync(FileSystem)) { // The EOCD/Header does not track directories, so it does not exist in `entries` if (this.directories.has(path)) { return new Stats({ - mode: 0o555 | FileType.DIRECTORY, + mode: 0o555 | S_IFDIR, size: 4096, mtimeMs: this._time, ctimeMs: this._time, diff --git a/src/zip.ts b/src/zip.ts index 1878e5b..776e011 100644 --- a/src/zip.ts +++ b/src/zip.ts @@ -1,5 +1,6 @@ -import { ErrnoError, Errno } from '@zenfs/core/error.js'; -import { FileType, Stats } from '@zenfs/core/stats.js'; +import { S_IFDIR, S_IFREG } from '@zenfs/core/emulation/constants.js'; +import { Errno, ErrnoError } from '@zenfs/core/error.js'; +import { Stats } from '@zenfs/core/stats.js'; import { deserialize, sizeof, struct, types as t } from 'utilium'; import { CompressionMethod, decompressionMethods } from './compression.js'; import { msdosDate, safeDecode } from './utils.js'; @@ -385,7 +386,7 @@ class FileEntry { public get stats(): Stats { return new Stats({ - mode: 0o555 | (this.isDirectory ? FileType.DIRECTORY : FileType.FILE), + mode: 0o555 | (this.isDirectory ? S_IFDIR : S_IFREG), size: this.uncompressedSize, mtimeMs: this.lastModified.getTime(), });