diff --git a/os/gcfg/gcfg_adapter_file_path.go b/os/gcfg/gcfg_adapter_file_path.go index bbe11904d41..981695b2e2f 100644 --- a/os/gcfg/gcfg_adapter_file_path.go +++ b/os/gcfg/gcfg_adapter_file_path.go @@ -216,9 +216,9 @@ func (a *AdapterFile) doGetFilePath(fileName string) (filePath string) { // Searching local file system. if filePath == "" { // Absolute path. - if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) { + /*if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) { return - } + }*/ a.searchPaths.RLockFunc(func(array []string) { for _, searchPath := range array { searchPath = gstr.TrimRight(searchPath, `\/`) @@ -235,6 +235,12 @@ func (a *AdapterFile) doGetFilePath(fileName string) (filePath string) { } }) } + if filePath == "" { + // Absolute path. + if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) { + return + } + } return }