Files
commons/file.go
George Suntres d829099a45 Add StringTitle
2026-03-30 18:29:58 -04:00

25 lines
518 B
Go

package commons
import (
"log"
"os"
"path/filepath"
)
// FileDeepScan will scan dir recursively and append any files found to files.
func FileDeepScan(dir string, files *[]string) {
entries, err := os.ReadDir(dir)
if err != nil {
log.Printf("Failed to read %v", err)
return
}
for _, entry := range entries {
fullPath := filepath.Join(dir, entry.Name())
if entry.IsDir() {
FileDeepScan(fullPath, files)
} else {
*files = append(*files, filepath.Join(dir, entry.Name()))
}
}
}