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:
21
vlib/os/os.c.v
Normal file
21
vlib/os/os.c.v
Normal 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{}
|
||||
)
|
Reference in New Issue
Block a user