• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa & File Attributes Confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa & File Attributes Confusion


  • Subject: Re: Cocoa & File Attributes Confusion
  • From: John Nestor <email@hidden>
  • Date: Sun, 10 Feb 2002 17:12:34 -0500

Perhaps - (NSDictionary *)fileAttributesAtPath:(NSString *)path traverseLink:(BOOL)flag

Clark S. Cox III wrote:


On Sunday, February 10, 2002, at 02:10 , Matt Ronge wrote:

I've been working with files and getting their attributes and I am getting
very confused.

Can someone outline the differences between NSFileManager, NSFileHandler


I assume you mean NSFileHandle

and
NSWorkSpace for me? Because I have looked at each of them and they all seem
to do the same things! Why isn't there a single NSFileManager that does
everything instead of all this stuff scattered around.



I'm very inclined to say RTFM, as there's virtually *no* overlap between the functionalities of these three classes, but here's a quick breakdown, 'cause I'm feeling nice.

NSFileManager - Use this to move files, copy files, delete files, check if files exist, and get the attributes of files.

NSFileHandle - An object of NSFileHandle is used to read and write data to and from a file (or other stream, such as stdin, stdout, stderr, etc.).

NSWorkspace - Part of the AppKit Framework (i.e. can *not* be used in Command-Line tools). Objects of this class are used to open files (as if they were double-clicked in the finder, or dragged to a specific application), launch other applications, get icons representing files, and deal with mounted volumes.


Why are there so many ways to find a files icon for example.



There's only one way that I can see:
NSImage *icon = [ [ NSWorkspace sharedWorkspace ] iconForFile: filePath ];

Or move a file?


Again, there's only one way that I can see:
BOOL succeeded = [ [ NSFileManager defaultManager ] movePath: src toPath: dest handler: handler ]

I'm confused.

Also, I can't figure out how to get a files creation date in Cocoa, huh? How
is this done?


To be honest, I'm not sure.


--
Clark S. Cox, III
email@hidden
http://www.whereismyhead.com/clark/

_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Cocoa & File Attributes Confusion (From: "Clark S. Cox III" <email@hidden>)

  • Prev by Date: Radar Question [OT]
  • Next by Date: Re: about help
  • Previous by thread: Re: Cocoa & File Attributes Confusion
  • Next by thread: Re: Cocoa & File Attributes Confusion
  • Index(es):
    • Date
    • Thread