mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: filepath module
This commit is contained in:
committed by
Alexander Medvednikov
parent
fe9d884d90
commit
7b1993b1e4
12
vlib/os/os.v
12
vlib/os/os.v
@@ -4,7 +4,7 @@
|
||||
|
||||
module os
|
||||
|
||||
import strings
|
||||
import filepath
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
@@ -920,13 +920,7 @@ pub fn mkdir_all(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO use []string.join once ...string becomes "[]string"
|
||||
pub fn join(base string, dirs ...string) string {
|
||||
mut path := strings.new_builder(50)
|
||||
path.write(base.trim_right('\\/'))
|
||||
for d in dirs {
|
||||
path.write(os.path_separator)
|
||||
path.write(d)
|
||||
}
|
||||
return path.str()
|
||||
println('use filepath.join')
|
||||
return filepath.join(base, dirs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user