mirror of
https://github.com/minio/minio.git
synced 2025-04-20 10:37:31 -04:00
parent
043aaa792d
commit
53a816b17a
@ -232,9 +232,16 @@ func readDirFn(dirPath string, fn func(name string, typ os.FileMode) error) erro
|
|||||||
// Return count entries at the directory dirPath and all entries
|
// Return count entries at the directory dirPath and all entries
|
||||||
// if count is set to -1
|
// if count is set to -1
|
||||||
func readDirWithOpts(dirPath string, opts readDirOpts) (entries []string, err error) {
|
func readDirWithOpts(dirPath string, opts readDirOpts) (entries []string, err error) {
|
||||||
f, err := OpenFile(dirPath, readMode, 0)
|
f, err := OpenFile(dirPath, readMode, 0o666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, osErrToFileErr(err)
|
if osIsPermission(err) {
|
||||||
|
f, err = Open(dirPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, osErrToFileErr(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return nil, osErrToFileErr(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user