How can I tell if a symbolic link exists at a certain path?
问题 I have an original file, /path/to/foo.txt , and a symbolic link to it, /other/path/to/foo.txt . I delete /path/to/foo.txt , but leave the symbolic link in-place. How can I tell that the symbolic link still exists using Cocoa APIs? I found this by using the standard/recommended FileManager.fileExists(atPath:). The problem here, for anyone unfamiliar with that API, is that it traverses symlinks. So, when I do this: FileManager.default.fileExists(atPath: "/other/path/to/foo.txt") it returns