mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
18 lines
305 B
Go
18 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
|
|
}
|