On Jan 18, 2013, at 15:21, Christiaan Hofman <[email protected]> wrote:

>> It seems to me that the problem is that the Alias is the canonical reference 
>> to the file, and an FSRef is used as a cache to avoid resolving the alias 
>> every time.  The problem arises when the FSRef and the Alias point to 
>> different files.  Ideally you would just resolve the Alias every time, but 
>> this is probably not a performant solution.  So the next best thing you can 
>> do is to determine when the cache is invalid and re-resolve it.  
> 
> A problem is: when, and how do you (i.e. the program) decide that?
> 
> Pulling in lastURL is not an option. It's already complex enough as it is, 
> based on relativePath, alias, and fileRef. Moreover, lastURL is not properly 
> (automatically) updated. It makes it more complex and more fragile. Note we 
> only update the fileRef when we already know it's invalid. Not when we think 
> there may (or may not) exist a better alternative, even we would decide it 
> would be a better alternative (and I'm not convinced even on that). That only 
> makes it more fragile, because we could be wrong. As always, losing a file is 
> far more a problem than getting a different file the user may not always 
> expect.


Here's a possible solution to the Dropbox problem (at least as Dropbox 
currently works): slightly expand the conditions upon which a fileRef is 
invalid. A fileRef could be considered invalid not only if it couldn't be 
resolved, but also if it resolves to a file that has an ancestor directory that 
starts with a dot. This would also address the possible case of a user manually 
moving a linked file to the Trash (i.e. ~/.Trash), then replacing it with a new 
file of the same name in the original location. If I were a user, I'd expect 
BibDesk to link to the new file, not the old file sitting in the Trash.

Cheers.

-Colin
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to