createNode method implemented, canRead,

canWrite,
canExecute methods implemented

common FileSystem error types implemented,

unit tests written and passing for filesystem initialization, createNode cases and permission methods
This commit is contained in:
2026-07-15 16:28:41 +02:00
parent 134d989f6e
commit ea82327ee8
7 changed files with 435 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
import type { TreeNodeType } from "./treenode";
export type FileSystemError = ParentNotFoundError | NotADirectoryError | AlreadyExistsError | NodeNotFoundError;
export interface ParentNotFoundError {
type: "ParentNotFound";
message: string;
timestamp: number;
parentInode: number;
}
export interface NotADirectoryError {
inode: number;
message: string;
timestamp: number;
type: "NotADirectory";
nodeType: TreeNodeType;
}
export interface AlreadyExistsError {
type: "AlreadyExists";
message: string;
timestamp: number;
parentInode: number;
name: string;
}
export interface NodeNotFoundError {
type: "NodeNotFound";
message: string;
inode: number;
timestamp: number;
}