We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
URL.resourceValues()
1 parent b3d8257 commit 0eff15aCopy full SHA for 0eff15a
Sources/TSCBasic/FileSystem.swift
@@ -370,8 +370,9 @@ private struct LocalFileSystem: FileSystem {
370
}
371
372
func isSymlink(_ path: AbsolutePath) -> Bool {
373
- let attrs = try? FileManager.default.attributesOfItem(atPath: path.pathString)
374
- return attrs?[.type] as? FileAttributeType == .typeSymbolicLink
+ let url = NSURL(fileURLWithPath: path.pathString)
+ let result = try? url.resourceValues(forKeys: [.isSymbolicLinkKey])
375
+ return (result?[.isSymbolicLinkKey] as? Bool) == true
376
377
378
func isReadable(_ path: AbsolutePath) -> Bool {
0 commit comments