mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-29 03:24:02 +03:00
30 lines
537 B
JavaScript
30 lines
537 B
JavaScript
const support_system_directory_fs = require("fs")
|
|
|
|
function support_system_directory_fileErrno(){
|
|
const n = process.__lasterr.errno;
|
|
switch(n){
|
|
case -17: return 4n;
|
|
default: return -BigInt(n)
|
|
}
|
|
}
|
|
|
|
function support_system_directory_changeDir(d){
|
|
try{
|
|
process.chdir(d);
|
|
return 0n
|
|
}catch(e){
|
|
process.__lasterr = e;
|
|
return 1n
|
|
}
|
|
}
|
|
|
|
function support_system_directory_createDir(d){
|
|
try{
|
|
support_system_directory_fs.mkdirSync(d)
|
|
return 0n
|
|
}catch(e){
|
|
process.__lasterr = e;
|
|
return 1n
|
|
}
|
|
}
|