MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / getLocalDirsAndFiles

Function getLocalDirsAndFiles

drivers/strm/hook.go:218–233  ·  view source on GitHub ↗
(localPath string)

Source from the content-addressed store, hash-verified

216}
217
218func getLocalDirsAndFiles(localPath string) ([]string, []string, error) {
219 var files, dirs []string
220 entries, err := os.ReadDir(localPath)
221 if err != nil {
222 return nil, nil, err
223 }
224 for _, entry := range entries {
225 fullPath := stdpath.Join(localPath, entry.Name())
226 if entry.IsDir() {
227 dirs = append(dirs, fullPath)
228 } else {
229 files = append(files, fullPath)
230 }
231 }
232 return files, dirs, nil
233}
234
235func init() {
236 op.RegisterObjsUpdateHook(UpdateLocalStrm)

Callers 1

deleteExtraFilesFunction · 0.85

Calls 3

NameMethod · 0.65
IsDirMethod · 0.65
ReadDirMethod · 0.45

Tested by

no test coverage detected