mirror of
https://github.com/pgsty/minio.git
synced 2026-08-11 00:33:28 +03:00
posix: Support UNC paths on windows. (#1887)
This allows us to now use 32K paths names on windows. Fixes #1620
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
4ab57f7d60
commit
ed4fe689b4
@@ -19,6 +19,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -26,10 +27,11 @@ import (
|
||||
|
||||
// Return all the entries at the directory dirPath.
|
||||
func readDir(dirPath string) (entries []string, err error) {
|
||||
d, err := os.Open(dirPath)
|
||||
d, err := os.Open(preparePath(dirPath))
|
||||
if err != nil {
|
||||
// File is really not found.
|
||||
if os.IsNotExist(err) {
|
||||
fmt.Println(preparePath(dirPath), err)
|
||||
return nil, errFileNotFound
|
||||
}
|
||||
|
||||
@@ -50,12 +52,12 @@ func readDir(dirPath string) (entries []string, err error) {
|
||||
return nil, err
|
||||
}
|
||||
for _, fi := range fis {
|
||||
// Skip special files.
|
||||
// Skip special files, if found.
|
||||
if hasPosixReservedPrefix(fi.Name()) {
|
||||
continue
|
||||
}
|
||||
if fi.Mode().IsDir() {
|
||||
// append "/" instead of "\" so that sorting is done as expected.
|
||||
// Append "/" instead of "\" so that sorting is achieved as expected.
|
||||
entries = append(entries, fi.Name()+slashSeparator)
|
||||
} else if fi.Mode().IsRegular() {
|
||||
entries = append(entries, fi.Name())
|
||||
|
||||
Reference in New Issue
Block a user