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 @@ -548,7 +548,15 @@ extension FileManager {
548548 var faAttributes : WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA ( )
549549 do { faAttributes = try windowsFileAttributes ( atPath: path) } catch { return false }
550550 if faAttributes. dwFileAttributes & DWORD ( FILE_ATTRIBUTE_REPARSE_POINT) == DWORD ( FILE_ATTRIBUTE_REPARSE_POINT) {
551- do { try faAttributes = windowsFileAttributes ( atPath: destinationOfSymbolicLink ( atPath: path) ) } catch { return false }
551+ do {
552+ let contents = try destinationOfSymbolicLink ( atPath: path)
553+ let resolvedPath = contents. isAbsolutePath
554+ ? contents
555+ : joinPath ( prefix: path. deletingLastPathComponent, suffix: contents)
556+ try faAttributes = windowsFileAttributes ( atPath: resolvedPath)
557+ } catch {
558+ return false
559+ }
552560 }
553561 if let isDirectory = isDirectory {
554562 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