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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user