Add a few useful os calls to nimscript (#7442)

This commit is contained in:
genotrance 2018-04-10 11:50:23 -05:00 • committed by Andreas Rumpf
commit f6c8f97fe8
4 changed files with 81 additions and 2 deletions

View file

@ -70,11 +70,17 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string;
setResult(a, os.getCurrentDir())
cbos moveFile:
os.moveFile(getString(a, 0), getString(a, 1))
cbos moveDir:
os.moveDir(getString(a, 0), getString(a, 1))
cbos copyFile:
os.copyFile(getString(a, 0), getString(a, 1))
cbos copyDir:
os.copyDir(getString(a, 0), getString(a, 1))
cbos getLastModificationTime:
# depends on Time's implementation!
setResult(a, int64(getLastModificationTime(getString(a, 0))))
cbos findExe:
setResult(a, os.findExe(getString(a, 0)))
cbos rawExec:
setResult(a, osproc.execCmd getString(a, 0))