
Signature
Michael Ash
Rogue Amoeba Software
> > You can perform file operations with NSWorkspace. Its main distinctive
> > feature (as fas as I can see) is that it can move files into the trash.
[quoted text clipped - 3 lines]
> test it in weird situations like external drives, network volumes, etc.
> The Trash is a complicated place.
Thanks for the warning. (We _must_ demand public access to Bug Tracker!)
I must say I have not experienced anything wrong while using NSWorkspace
for trashing files.
I'm not sure why NSWorkspace duplicates functionality found in
NSFileManager. Maybe it will automatically call noteFileSystemChanged:
after the operation, but the documentations doesn't say so.
patirck
Michael Ash - 29 Oct 2006 03:48 GMT
> Thanks for the warning. (We _must_ demand public access to Bug Tracker!)
File a bug about it. :)
> I must say I have not experienced anything wrong while using NSWorkspace
> for trashing files.
I could always be wrong.
> I'm not sure why NSWorkspace duplicates functionality found in
> NSFileManager. Maybe it will automatically call noteFileSystemChanged:
> after the operation, but the documentations doesn't say so.
I suspect it's for consistency. You already have a bunch of operations
that NSFileManager can't do, you might as well throw in a couple that it
can do. But NSWorkspace can't substitute for NSFileManager because
NSFileManager has a bunch of other stuff, and NSWorkspace is in AppKit,
not Foundation.
If you want duplicated functionality, look at URL loading. I haven't
really counted, but there are probably at least a half-dozen ways to load
the contents of a URL, most of them broken in different and interesting
ways.

Signature
Michael Ash
Rogue Amoeba Software