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

szip: expose zip_folder (#14356)

This commit is contained in:
Larpon
2022-05-11 15:48:41 +02:00
committed by GitHub
parent 3afc7c4c6d
commit 0ec1c8d9f0
3 changed files with 104 additions and 26 deletions

View File

@@ -563,7 +563,7 @@ pub fn walk(path string, f fn (string)) {
pub type FnWalkContextCB = fn (voidptr, string)
// walk_with_context traverses the given directory `path`.
// For each encountred file, it will call your `fcb` callback,
// For each encountred file and directory, it will call your `fcb` callback,
// passing it the arbitrary `context` in its first parameter,
// and the path to the file in its second parameter.
pub fn walk_with_context(path string, context voidptr, fcb FnWalkContextCB) {
@@ -580,10 +580,9 @@ pub fn walk_with_context(path string, context voidptr, fcb FnWalkContextCB) {
}
for file in files {
p := path + local_path_separator + file
fcb(context, p)
if is_dir(p) && !is_link(p) {
walk_with_context(p, context, fcb)
} else {
fcb(context, p)
}
}
return