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

vlib: reimplement glob in V for UNIX to not depend on libc (#10707)

This commit is contained in:
pancake
2021-07-09 02:27:16 +02:00
committed by GitHub
parent 151cd0bfe6
commit 47bf64473c
4 changed files with 152 additions and 49 deletions

View File

@@ -627,3 +627,12 @@ pub fn is_atty(fd int) int {
return C.isatty(fd)
}
}
pub fn glob(patterns ...string) ?[]string {
mut matches := []string{}
for pattern in patterns {
native_glob_pattern(pattern, mut matches) ?
}
matches.sort()
return matches
}