Skip to content

Commit

Permalink
Delete Delete file because it does not work well. Instead spawn rm
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkar598 committed Jun 23, 2023
1 parent 9514116 commit 90ddc78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/vm/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ class Emulator extends TypedEmitter<EmulatorEvents> {
this.once(`async-${commandID}`, resolve);
});

public deleteFile = (name: string) => {
this.sendCommand({ command: "deleteFile", name });
};

public resetTerminal = () => {
this.sendCommand({ command: "resetTerminal" });
};
Expand Down
6 changes: 4 additions & 2 deletions src/vm/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ class Executor extends TypedEmitter<ExecutorEvents> {
})
.finally(() => {
if (stageAbort) stageAbort();
emulator.deleteFile(filename + ".dme");
emulator.deleteFile(filename + ".dmb");
commandQueue.runProcess(
"/bin/rm",
`/mnt/host/${filename}.dme\0/mnt/host/${filename}.dmb`,
);
}, true);
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/vm/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ interface MsgSendFile {
name: string;
data: Uint8Array;
}
interface MsgDeleteFile {
command: "deleteFile";
name: string;
}
interface MsgResetTerminal {
command: "resetTerminal";
data?: undefined;
Expand All @@ -48,7 +44,6 @@ export type WorkerMsgWithoutCID =
| MsgStart
| MsgPause
| MsgSendFile
| MsgDeleteFile
| MsgResetTerminal

export type WorkerMsg = WorkerMsgWithoutCID & {
Expand Down Expand Up @@ -203,10 +198,6 @@ onmessage = ({ data: e }: MessageEvent<WorkerMsg>) => {
});
break;
}
case "deleteFile": {
emulator.fs9p.DeleteNode(e.name);
break;
}
case "resetTerminal": {
if (!emulator.is_running()) return;
if (resetting) return;
Expand Down

0 comments on commit 90ddc78

Please sign in to comment.