Snow Leopard introduced many new methods to use NSURL objects to refer to files, not pathnames or Core Services\' FSRefs.
However, there\'s one task I can\'t find a
Because NSURL can represents more that local file-systems, I don't think that there is a generic method that can test for their existence in a reliable way. At least, the Cocoa foundation does not contains such a function (as far as I know).
If you only deal with local file-systems, I suggest you to create a category for NSURL
or for NSFileManager
, with a urlExists:
message. It would convert the NSURL
to a NSString
(normalized path) and then invoke the [NSFileManager fileExistsAtPath:]
message.