Re: NSWorkspace vs NSFileManager
Re: NSWorkspace vs NSFileManager
- Subject: Re: NSWorkspace vs NSFileManager
- From: j o a r <email@hidden>
- Date: Wed, 10 Nov 2004 08:31:19 +0100
On 2004-11-09, at 23.25, Christoffer Lerno wrote:
I am moving files and I am deciding if I want to work either through
NSWorkspace or NSFileManager.
Is there any differences between them other than the way their methods
are invoked?
There is always the general difference between Foundation and AppKit,
in that if you write something that you expect to be able to run
without the requirement that you need to be logged in for it to work,
you should use Foundation only. If you on the other hand write a GUI
app, you can also use stuff from AppKit.
NSWorkspace provides Finder-like functionality for Cocoa apps, ie.
access to the GUI / higher level functionality of file management, like
for example association between GUI applications and files, launching
GUI apps, et.c. Had it been implemented today it probably would have
been called NSFinder, but at the time when it was implemented, the
Finder was known as "Workspace".
In the early days of Mac OS X I think that NSFileManager had some
problems with things like resource forks. I don't know for certain, but
I don't think that there are any problems like that anymore - but check
the documentation to be sure. I guess that some other list member will
correct me if I'm wrong, or if I forgot something.
I'd also like the any file moved to/from the desktop to immediately be
visible/disappear after the move.
With NSFileManager at least, the desktop needs to refresh before the
change is visible, something which doesn't happen immediately - is
there some way of improving this behaviour?
NSFileManager doesn't know about the Finder. Currently, you need to let
the Finder know when you have updated the file system, you do that
using the methods in NSWorkspace (noteFileSystemChanged:). I think that
this is an unfortunate bug / limitation in Finder, it should pick up
file system changes automatically. Still, it's a feature of the current
implementation that you will have to deal with.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden