encoding shenanigans

This commit is contained in:
minjaesong
2023-05-09 21:40:17 +09:00
parent 831485bc35
commit 3c758ba82f
6 changed files with 42 additions and 5 deletions

View File

@@ -109,6 +109,11 @@ for (let i = 0; i < sectionTable.length - 1; i++) {
}
}
_G.shell.execute(PATH_MOUNT + "run.com")
let errorlevel = _G.shell.execute(PATH_MOUNT + "run.com")
// TODO delete PATH_MOUNT
try {
files.open(PATH_MOUNT).remove()
}
catch (e) {}
return errorlevel

View File

@@ -762,7 +762,16 @@ _TVDOS.DRV.FS.DEVTMP.mkFile = (fd) => {
return true
}
_TVDOS.DRV.FS.DEVTMP.remove = (fd) => {
let path = _TVDOS.TMPFS[fd.path]
delete _TVDOS.TMPFS[fd.path]
// delete all the keys starting with _TVDOS.TMPFS[fd.path]
if (_TVDOS.DRV.FS.DEVTMP.isDirectory(fd)) {
Object.keys(_TVDOS.TMPFS).filter(it=>it.startsWith(path)).forEach(childs=>{
delete _TVDOS.TMPFS[childs]
})
}
return true
}
_TVDOS.DRV.FS.DEVTMP.exists = (fd) => (_TVDOS.TMPFS[fd.path] !== undefined)

View File

@@ -0,0 +1,16 @@
function printUsage() {
println(`Usage: gzip [/d /c] file
To compress a file, replacing it with a gzipped compressed version:
gzip file.ext
To decompress a file, replacing it with the original uncompressed version:
gzip /d file.ext.gz
To compress a file specifying the output filename:
gzip /c file.ext > compressed_file.ext.gz
To decompress a gzipped file specifying the output filename:
gzip /c /d file.ext.gz > uncompressed_file.ext`)
}
if (exec_args[1] === undefined) {
printUsage()
return 0
}