Re: Knowing file system changes?
Re: Knowing file system changes?
- Subject: Re: Knowing file system changes?
- From: David Remahl <email@hidden>
- Date: Sat, 13 Apr 2002 15:37:37 +0200
>
Unfortunately, I don't believe this API will do you anything without the
>
old Workspace.app functionality working (and since Workspace.app no
>
longer exists and Finder doesn't send NSNotifications ...)
Apple has integrated this notification scheme with the Carbon-based one that
is currently used. The API I'm talking about is defined in
<CarbonCore/Files.h> and its main functions are FNSubscribe() and
FNNotify().
>
OS X does not provide a generic mechanism for you to receive
>
notifications about the creation, copying, moving, deletion, etc. of
>
files.
It does.
>
There are requests to do so at the file system layer. As far as I know
>
there are no current plans. You would need to query a Darwin list and
>
talk to the filesystem team on those lists.
I don't think there are such plans no. Filesystem notifications are now the
responsibility of applications changing the system.
>
You will need to narrow down your subject a little more if that is what
>
you are trying to do. You can easily poll a single directory (or
>
multiple directories) without issue, but you cannot receive generic
>
notifications at this time.
Check out this page I set up on CocoaDev yesterday (_before_ getting this
mail). I posted about it to the list, but it maybe got lost? The page also
discusses some limitations.
http://www.cocoadev.com/index.pl?FilesystemNotifications
/ David Remahl
PS. I just verified that the NSWorkspace API and the Carbon FN API are
interoperable. DS.
>
Eric
>
>
>
On Saturday, April 13, 2002, at 08:06 AM, Lorenzo Puleo wrote:
>
>
>> Hi everybody
>
>>
>
>> I am new to Cocoa programing and am having a problem.
>
>>
>
>> Is it possible to know, using Cocoa or C, when a change, such as
>
>> creation or
>
>> copying or moving or renaming of a file, occurs in the file system? If
>
>> so
>
>> how?
>
>>
>
>> TIA
>
>>
>
>> With regards
>
>>
>
>> Gokul
>
>
>
>
>
> Hi,
>
> I'm not sure this is what you mean. Anyway it could help to find the
>
> way for
>
> solving your question. To know more about this, go to the Bacth-Find
>
> area
>
> and type "NSWorkspace". There you will find many other stuffs.
>
>
>
>
>
> BOOL hasChanged;
>
> hasChanged = [[NSWorkspace sharedWorkspace] fileSystemChanged];
>
>
>
>
>
> - (BOOL)fileSystemChanged
>
> Returns YES if a change to the file system has been registered with a
>
> noteFileSystemChanged message since the last fileSystemChanged message;
>
> NO
>
> otherwise.
>
>
>
>
>
> Bye
>
> --
>
> Lorenzo Puleo
>
> mailto:email@hidden
_______________________________________________
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.