mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-11 20:12:54 +02:00
19 lines
305 B
Go
19 lines
305 B
Go
package utils
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/navidrome/navidrome/log"
|
|
)
|
|
|
|
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
|
|
}
|