- moved index code to dev.ts

- some work i dont know about or dont remember ¯\_(ツ)_/¯
This commit is contained in:
2026-09-11 22:50:08 +02:00
parent ec13299e95
commit 9c5bd71a5c
8 changed files with 153 additions and 138 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import { TreeNodeType, type DirectoryNode, type TreeNode } from "../filesystem/t
""
*/
export function resolvePath(state: ShellState, path: string): number {
export function resolvePath(state: ShellState, path: string): string {
const session = getCurrentSession(state);
const isAbsolute = path.startsWith("/"); // true
@@ -40,7 +40,7 @@ export function resolvePath(state: ShellState, path: string): number {
continue;
}
const inode = currentNode.children[name];
const inode = currentNode.content.get(name);
if (!inode)
throw {
+28
View File
@@ -0,0 +1,28 @@
import type { IDataStore, NodeHash, ShadowHash, VDisk } from "@core/filesystem/vdisk";
export class VDiskManager {
private _VDiskHash: Map<number, VDisk> = new Map();
public getVDisk(id: number): VDisk | undefined {
const result = this._VDiskHash.get(id);
if (result) return result;
return undefined;
}
public registerVDisk(
store: IDataStore,
base: NodeHash = new Map(),
overlay: ShadowHash = new Map(),
id: number = 0,
): number {
const vdisk: VDisk = {
id,
store,
base,
overlay,
};
this._VDiskHash.set(id, vdisk);
return id;
}
}