- Fixed cat command
- Moved device config initialization to `serializer.ts` - Minor bugfixes - Added `read()` to `filesystem.ts`
This commit is contained in:
@@ -121,6 +121,15 @@ export class FileSystem {
|
||||
return this.resolveNode(ptr) !== undefined;
|
||||
}
|
||||
|
||||
public async read(ptr: NodePointer): Promise<Uint8Array> {
|
||||
const dev = this._VDiskManager.getDisk(ptr.device);
|
||||
if (!dev) return new Uint8Array();
|
||||
const node = dev.getNode(ptr.inode);
|
||||
if (!node) return new Uint8Array();
|
||||
|
||||
return dev.readContent((node as FileNode).content);
|
||||
}
|
||||
|
||||
public mount(mount: NodePointer, target: NodePointer) {
|
||||
if (!this._VDiskManager.hasDisk(mount.device)) {
|
||||
throw {
|
||||
|
||||
Reference in New Issue
Block a user