On May 21, 2012, at 19:49 , Harris Magner <harris.mag...@gmail.com> wrote:

> I tried renaming the foo.bar to bar.bib on my machine while Bibdesk was 
> active, and as you said the change was tracked, and Bibdesk was using 
> bar.bib. But once I close Bibdesk and reopen it, it doesn't show anything, 
> because in settings I had set it to open foo.bar when it opens, and after I 
> renamed to bar.bib, this change wasn't added in the config, what I would 
> expect. So I think the rename problem is not just between two different 
> machines, but also on the same machine.

That's a good illustration, actually.  The last open file and default file are 
both saved as aliases, and we (or at least I) expected those to be more robust. 
 After thinking a bit, more than likely the alias data has gone stale since you 
set it in preferences, so the fileID/inode tracking no longer worked once the 
path went invalid.  There are numerous ways this could happen.  Then again, 
should the path shown in preferences change once you rename the file?  Things 
just go haywire very quickly when you start mixing alias/FSRef files and paths, 
unless you control all of the code (as we do with linked files).

Apple's NSDocument probably uses an FSRef, or maybe one of the new bookmark 
URLs to associate with its file, and basically appears to poll for file changes 
when the application is brought to the foreground.  Further, debugging 
indicates that they do this with a time-delayed message send, so it doesn't 
happen immediately.  If we watched for file changes, we'd have to take into 
account Apple's time delay, plus the fact that it might change in the future to 
use something smarter, like a kqueue.  If Apple provided a way to hook into 
their change notice or disable it, the problem would be more tractable.

-- 
Adam


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to