/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
pkg/fs/resolve.go
21 строка
496 B
Michael Mayer
Index: Skip redundant thumbs and support symbolic file links #1049 #1874
07 июл 2022, 00:01
07 июл 2022, 00:01
5ec90a5
Код
Авторство
О чём код?
package fs import ( "errors" "path/filepath" ) // Resolve returns the absolute file path, with all symlinks resolved. func Resolve(filePath string) (string, error) { if filePath == "" { return "", errors.New("no such file or directory") } if target, err := filepath.EvalSymlinks(filePath); err != nil { return "", errors.New("no such file or directory") } else if target, err = filepath.Abs(target); target != "" { return target, err } else { return filepath.Abs(filePath) } }