feat: persistant Task (#6925 close #5313)

This commit is contained in:
itsHenry
2024-08-07 12:16:21 +08:00
committed by GitHub
parent f2727095d9
commit 74f8295960
15 changed files with 201 additions and 56 deletions

View File

@ -26,3 +26,16 @@ func GetFiles(dir string) ([]File, error) {
}
return files, nil
}
func GetFile(path string) (File, error) {
info, err := os.Stat(path)
if err != nil {
return File{}, err
}
return File{
Name: info.Name(),
Size: info.Size(),
Path: path,
Modified: info.ModTime(),
}, nil
}