1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

js: port more methods (os, builtin) (#12238)

This commit is contained in:
playX
2021-10-20 16:02:21 +03:00
committed by GitHub
parent 7c1fff3495
commit 57c79770b3
6 changed files with 83 additions and 8 deletions

View File

@@ -133,3 +133,20 @@ pub fn glob(patterns ...string) ?[]string {
panic('not yet implemented')
return none
}
pub fn write_file_array(path string, buffer array) ? {
mut f := create(path) ?
f.write_array(buffer) ?
f.close()
}
pub fn chdir(s string) ? {
#try { $process.chdir(s.str); } catch (e) { return error(new string('' + s)) }
}
pub fn file_last_mod_unix(path string) int {
mtime := 0
#mtime.val = Math.floor($fs.lstatSync(path.str).mtime.getTime() / 1000)
return mtime
}