2020-06-12 09:26:46 -08:00
|
|
|
package utils
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
|
2021-02-06 17:46:35 -09:00
|
|
|
"github.com/navidrome/navidrome/log"
|
2020-06-12 09:26:46 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func IsDirReadable(path string) (bool, error) {
|
|
|
|
|
dir, err := os.Open(path)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if err := dir.Close(); err != nil {
|
|
|
|
|
log.Error("Error closing directory", "path", path, err)
|
|
|
|
|
}
|
|
|
|
|
return true, nil
|
|
|
|
|
}
|