Re: Force Finder to update *All* files within a folder (Slightly Off Topic)
Re: Force Finder to update *All* files within a folder (Slightly Off Topic)
- Subject: Re: Force Finder to update *All* files within a folder (Slightly Off Topic)
- From: Nate Alf <email@hidden>
- Date: Thu, 05 Jun 2003 07:07:27 -0500
The below technote describes how to update a local machine - this does not send a notification to every other mac on the network to let them know a file has been updated on the file server (nor should it.) I am not sure what OS 9 did - but it seemed to work properly.
http://www.cocoadev.com/index.pl?FilesystemNotifications states:
>
>Filesystem notifications is the mechanism that Mac OS X and the Finder uses to keep an updated view of the filesystem. In Mac OS 9, the Finder conducted a lot of polling, to check for changes in the file system. This approach was dropped in X, probably for performance reasons. It is now the responsibility of all processes to notify each other of changes (file creations, deletions, etc).
There is API for FN both in Carbon and in Cocoa, but the Cocoa API is not complete at the moment.
The main problem with this logic is that if another machines updates a file on the server - another mac viewing the same folder doesn't redraw the updates to match what is currently on the server file system.
For example - you are waiting for a file to be updated (this is being done on another machine) - you set the Finder view to sort by date modified while this updated file is saved out. The window on your machine will never update to bring the file to the top - until you actually select the file - then it updates and jumps to the top. (or eject the server and remount it.)
I won't pretend to hold all the answers to this, but a fix might be that every time a Finder window was selected - the contents would update to match the file system. (The Finder should probably only apply this logic to anything past the /Volumes/ directory which is network based.)
Nate
On Thursday, June 05, 2003, at 00:32AM, Creed Erickson <email@hidden> wrote:
>
Apple's Technical Q&A QA1260 deals with this.
>
http://developer.apple.com/qa/qa2001/qa1260.html
>
>
On Wednesday, June 4, 2003, at 11:39 AM, Nathan Alf wrote:
>
>
> We are beginning to move the prepress company I work for to MacOSX -
>
> and there are a few issues
>
> that have come to light.
>
>
>
> One of the main gripes I hear from end users is that files on our
>
> windows 200 server that have been
>
> added or modified by server automation - or another user is not
>
> relected by the Finder.
>
>
>
> In doing a bit more research - I have arrived upon this:
>
>
>
> [[NSWorkspace sharedWorkspace]
>
> noteFileSystemChanged:@"/Volumes/Server/FolderToUpdate/"];
>
>
>
> will reveal files if they are not listed - but will not update
>
> modification dates,file sizes,
>
> icons, etc..
>
>
>
> One can point noteFileSystemChanged all the way down to the exact
>
> file - and it will
>
> update properly - revealing any changes (size, modification dates,
>
> icons, etc.):
>
>
>
> [[NSWorkspace sharedWorkspace]
>
> noteFileSystemChanged:@"/Volumes/Server/Folder/fileToUpdate"];
>
>
>
> So - with this said - I made an application that gets the frontmost
>
> window, gets a list of every
>
> item within the folder, and updates them all - gave it a refresh icon,
>
> and dropped it into the
>
> Finder toolbar. So far so good - but it was a bit distracting to have
>
> the app come to the front, so
>
> I made the Finder activate again right when the app is called.
>
>
>
> So the reason I am writing this is:
>
>
>
> Is there anyway to get this same functionality without this crude
>
> hack?
>
>
>
> Truthfully I am a bit unimpressed with the Finder - and it would be
>
> really nice if bringing a
>
> window to the front would update all the files - or if Apple would
>
> include a refresh button by
>
> default.
>
>
>
> If anyone has any better ideas on this - please let me know.
>
>
>
> Thanks for tuning in -
>
>
>
> Nate Alf
>
> _______________________________________________
>
> 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.
>
>
>
>
>
---
>
Creed Erickson <email@hidden>
>
"Not a shred of evidence exists in favor of the idea that life is
>
serious."
>
- Brendan Gill
_______________________________________________
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.