mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
windows: Support all REPARSE_POINT attrib files properly. (#4203)
This change adopts the upstream fix in this regard at https://go-review.googlesource.com/#/c/41834/ for Minio's purposes. Go's current os.Stat() lacks support for lot of strange windows files such as - share symlinks on SMB2 - symlinks on docker nanoserver - de-duplicated files on NTFS de-duplicated volume. This PR attempts to incorporate the change mentioned here https://blogs.msdn.microsoft.com/oldnewthing/20100212-00/?p=14963/ The article suggests to use Windows I/O manager to dereference the symbolic link. Fixes #4122
This commit is contained in:
@@ -22,11 +22,11 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
os2 "github.com/minio/minio/pkg/x/os"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@@ -122,7 +122,7 @@ func saveFileConfig(filename string, v interface{}) error {
|
||||
// decoder format according to the filename extension. If no
|
||||
// extension is provided, json will be selected by default.
|
||||
func loadFileConfig(filename string, v interface{}) error {
|
||||
if _, err := os.Stat(filename); err != nil {
|
||||
if _, err := os2.Stat(filename); err != nil {
|
||||
return err
|
||||
}
|
||||
fileData, err := ioutil.ReadFile(filename)
|
||||
|
||||
Reference in New Issue
Block a user