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

js: os now compiles to the JS backend, more builtins & minor codegen fixes (#11302)

This commit is contained in:
playX
2021-08-25 14:40:53 +03:00
committed by GitHub
parent f257a23313
commit 109d5d5847
15 changed files with 479 additions and 369 deletions

21
vlib/os/os.c.v Normal file
View File

@@ -0,0 +1,21 @@
module os
// write_file_array writes the data in `buffer` to a file in `path`.
pub fn write_file_array(path string, buffer array) ? {
mut f := create(path) ?
unsafe { f.write_full_buffer(buffer.data, size_t(buffer.len * buffer.element_size)) ? }
f.close()
}
pub fn glob(patterns ...string) ?[]string {
mut matches := []string{}
for pattern in patterns {
native_glob_pattern(pattern, mut matches) ?
}
matches.sort()
return matches
}
pub const (
args = []string{}
)