Remove cluster chain from directory entries
This commit is contained in:
parent
9ff9642f65
commit
1497ee2df6
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user