- Fixed all of path_resolver.ts functions

- `resolveInode` functions now `resolvePointer`
- Fixed all resolve pointer -> path functions
This commit is contained in:
2026-11-10 12:02:21 +01:00
parent 584e594726
commit 00200b4c75
3 changed files with 56 additions and 31 deletions
+6 -6
View File
@@ -13,12 +13,10 @@ namespace Termos {
//import { FileSystem } from "@core/filesystem/filesystem";
import { FileSystem } from "@core/filesystem/filesystem";
import type { IDataStore, IMetaStore, VDiskConfig } from "@core/filesystem/vdisk";
import type { GroupInfo, UserInfo } from "@core/session_manager";
import { getCurrentSession, type GroupInfo, type UserInfo } from "@core/session_manager";
import { createInitialShellState, type ShellState } from "@core/shell_state";
import { resolvePointer } from "@core/util/path_resolver";
import { MemDataStore, MemMetaStore } from "@core/util/temp_mem_stores";
//import { getCurrentSession, type GroupInfo, type UserInfo } from "@core/session_manager";
//import { createInitialShellState, type ShellState } from "@core/shell_state";
//import { resolveInodeToHome } from "@core/util/path_resolver";
import { deserializeFileSystem } from "@shell/serializer";
import { Shell } from "@shell/shell";
//import { deserializeFileSystem } from "@shell/serializer";
@@ -47,7 +45,7 @@ for (const i of arr) {
devices.push({ dstore: data, mstore: meta, config });
}
const fs = FileSystem.init(devices);
const fs = await FileSystem.init(devices);
const users: Map<number, UserInfo> = new Map();
const groups: Map<number, GroupInfo> = new Map();
@@ -56,7 +54,7 @@ const user: UserInfo = {
uid: 1000,
gid: 1000, // <- PRIMARY GID
group: [1000], // <- GROUPS ARRAY
home: 14,
home: "0:14",
};
const group: GroupInfo = {
groupname: "kamil",
@@ -69,6 +67,8 @@ groups.set(1000, group);
const state: ShellState = createInitialShellState(fs, users, groups, user);
Shell.init(state);
console.log(resolvePointer(state, "0:15"));
//console.log(resolveInode(Shell.Instance?.State!, 6));
//console.log(resolveInode(Shell.Instance?.State!, 6, true));