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 {
539
539
var faAttributes : WIN32_FILE_ATTRIBUTE_DATA = WIN32_FILE_ATTRIBUTE_DATA ( )
540
540
do { faAttributes = try windowsFileAttributes ( atPath: path) } catch { return false }
541
541
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
+ }
543
551
}
544
552
if let isDirectory = isDirectory {
545
553
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