File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -539,7 +539,15 @@ extension FileManager {
539539 var faAttributes : WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA ( )
540540 do { faAttributes = try windowsFileAttributes ( atPath: path) } catch { return false }
541541 if faAttributes. dwFileAttributes & DWORD ( FILE_ATTRIBUTE_REPARSE_POINT) == DWORD ( FILE_ATTRIBUTE_REPARSE_POINT) {
542- do { try faAttributes = windowsFileAttributes ( atPath: destinationOfSymbolicLink ( atPath: path) ) } catch { return false }
542+ do {
543+ let contents = try destinationOfSymbolicLink ( atPath: path)
544+ let resolvedPath = contents. isAbsolutePath
545+ ? contents
546+ : joinPath ( prefix: path. deletingLastPathComponent, suffix: contents)
547+ try faAttributes = windowsFileAttributes ( atPath: resolvedPath)
548+ } catch {
549+ return false
550+ }
543551 }
544552 if let isDirectory = isDirectory {
545553 isDirectory. pointee = ObjCBool ( faAttributes. dwFileAttributes & DWORD ( FILE_ATTRIBUTE_DIRECTORY) == DWORD ( FILE_ATTRIBUTE_DIRECTORY) )
You can’t perform that action at this time.
0 commit comments