1
0
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:
joe-conigliaro
2019-11-02 03:29:51 +11:00
committed by Alexander Medvednikov
parent fe9d884d90
commit 7b1993b1e4
4 changed files with 44 additions and 12 deletions

View File

@@ -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)
}