more chdir wip

This commit is contained in:
minjaesong
2020-11-07 17:33:54 +09:00
parent 954307a7f9
commit f01345fb6f
4 changed files with 26 additions and 1 deletions

View File

@@ -69,6 +69,16 @@ filesystem.readAll = function(driveLetter) {
}
return com.pullMessage(port[0]);
};
filesystem.isDirectory = function(driveLetter) {
let port = filesystem._toPorts(driveLetter);
com.sendMessage(port[0], "LISTFILES");
let response = com.getStatusCode(port[0]);
if (135 == response) {
throw Error("File not opened");
}
return (response === 0);
}
Object.freeze(filesystem);
///////////////////////////////////////////////////////////////////////////////