From 1497ee2df643dffd60cd386afecd8b572c82ae61 Mon Sep 17 00:00:00 2001 From: Jordan Goulder Date: Mon, 20 Jan 2025 11:19:03 -0500 Subject: [PATCH] Remove cluster chain from directory entries --- src/floppy/disk.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/floppy/disk.ts b/src/floppy/disk.ts index caa20f0..9d23ab5 100644 --- a/src/floppy/disk.ts +++ b/src/floppy/disk.ts @@ -48,7 +48,6 @@ export interface IStandardDirEntry { attributes: IAttributes size: number firstCluster: number - clusterChain: number[] subDirEntries: TDirEntry[] } @@ -349,20 +348,19 @@ function decodeDirectoryEntry(data: DataView, fd: FloppyDisk): TDirEntry | null extension, attributes, firstCluster, - clusterChain: [], size, subDirEntries: [], } if (entry.attributes.directory && entry.name !== '.' && entry.name !== '..') { - entry.clusterChain = fd.clusterChain(entry.firstCluster) + const clusterChain = fd.clusterChain(entry.firstCluster) - const dataSize = entry.clusterChain.length * fd.bytesPerCluster + const dataSize = clusterChain.length * fd.bytesPerCluster if (dataSize !== 0) { const entryData = new Uint8Array(dataSize) - for (let i = 0; i < entry.clusterChain.length; i++) { - const offset = (entry.clusterChain[i] - 2) * fd.bytesPerCluster + for (let i = 0; i < clusterChain.length; i++) { + const offset = (clusterChain[i] - 2) * fd.bytesPerCluster const view = new Uint8Array(fd.buffer, fd.dataOffset + offset, fd.bytesPerCluster) entryData.set(view, i * fd.bytesPerCluster) }