basic:catalog function (same as ls/dir)

This commit is contained in:
minjaesong
2020-11-14 14:13:46 +09:00
parent 34cfec60c7
commit 4977829c38

View File

@@ -1465,6 +1465,17 @@ bF.load = function(args) { // LOAD function
cmdbuf[lnum] = line.slice(i + 1, line.length);
});
};
bF.catalog = function(args) { // CATALOG function
if (args[1] === undefined) args[1] = "\\";
let pathOpened = fs.open(args[1], 'R');
if (!pathOpened) {
throw lang.noSuchFile;
return;
}
let port = _BIOS.FIRST_BOOTABLE_PORT[0];
com.sendMessage(port, "LIST");
println(com.pullMessage(port));
};
Object.freeze(bF);
while (!tbasexit) {
let line = sys.read().trim();