mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
reading and eval()ing file using dos kernel
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -38,14 +38,14 @@ filesystem.open = function(driveLetter, path, operationMode) {
|
||||
}
|
||||
|
||||
com.sendMessage(port[0], "OPEN"+mode+'"'+path+'",'+port[1]);
|
||||
let response = com.getStatusCode();
|
||||
let response = com.getStatusCode(port[0]);
|
||||
return (response == 0);
|
||||
};
|
||||
// @return the entire contents of the file in String
|
||||
filesystem.readAll = function() {
|
||||
filesystem.readAll = function(driveLetter) {
|
||||
let port = filesystem._toPorts(driveLetter);
|
||||
com.sendMessage(port[0], "READ");
|
||||
let response = com.getStatusCode();
|
||||
let response = com.getStatusCode(port[0]);
|
||||
if (response < 0 || response >= 128) {
|
||||
let status = com.getDeviceStatus(port[0]);
|
||||
throw Error("Reading a file failed with "+status.code+": "+status.message);
|
||||
|
||||
Reference in New Issue
Block a user