NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?
NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?
- Subject: NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?
- From: Tito Ciuro <email@hidden>
- Date: Fri, 28 May 2010 17:01:55 +0200
Hello,
I'm trying to replace the following deprecated NSFileManager method:
> /* attributesOfItemAtPath:error: returns an NSDictionary of key/value pairs containing the attributes of the item (file, directory, symlink, etc.) at the path in question. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
>
> This method replaces fileAttributesAtPath:traverseLink:.
> */
> - (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error;
The old statement traverses the link:
NSDictionary* attr = [[NSFileManager defaultManager] fileAttributesAtPath:file traverseLink:YES];
The problem is that the header states that 'attributesOfItemAtPath:error:' that it's a replacement for 'fileAttributesAtPath:traverseLink:', but provides no provision for traversing the link.
How would I obtain the attributes of an item that needs to be traversed first?
Thanks,
-- Tito
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden