potionfactory / LetsMove

A sample that shows how to move a running Mac application to the /Applications directory
http://www.potionfactory.com/blog/2009/09/17/move-applications-folder
963 stars 137 forks source link

Endless while loop in -[NSString stringByIterativelyResolvingSymlinkOrAlias] when link is in /private/var/... #20

Closed AJet closed 11 years ago

AJet commented 11 years ago

I accidentally noticed this problem when I tried to use my app to open an image created but not yet saved by Slicy app. (I hit Space bar in Slicy to view the image in QuickLook, then pressed the "Open with MyApp" button to launch my app.)

The path appeared to be the following:

/private/var/folders/zz/tgcc5k_17cscxxwb212fydw80000gn/T/CB856778-0148-4C5F-B15C-839B6EF77469/SNPlaceholder.png

My app uses your -[NSString stringByResolvingSymlinksAndAliases] to resolve possible symlink in the path before opening the file, however, this causes an endless while loop in -[NSString stringByIterativelyResolvingSymlinkOrAlias].

I'm not sure how to fix it myself. Your help would be greatly appreciated!

andypotion commented 11 years ago

Just started looking at this. Did you guys get anywhere with this?

AJet commented 11 years ago

No, I feel a little shaky with this stuff.

andypotion commented 11 years ago

Okay, I'm going to try to reproduce it, but if you can send me a little sample app that shows the problem, I bet that I can fix it much faster :)

andypotion commented 11 years ago

Which one is your app? On my Mac, Preview is configured to open png files. I take it that it's not DaisyDisk?

BTW, I didn't write that method myself, that's actually Matt Gallagher's code we're trying to debug :)

andypotion commented 11 years ago

Testing just the method itself with a temporary image that Slicy creates seems fine:

NSString *resolved = [@"/private/var/folders/ms/b8ywc7xs2d58mxj6tzsxyc2h0000gn/T/3A0BE22B-B35A-475E-BC8A-238D180FBBE1/Star2.png" stringByIterativelyResolvingSymlinkOrAlias];

NSLog(@"resolved: %@", resolved);

I'm testing this on 10.8.3. If you give me more information, I'll take a look at this again, but for now I'm closing it.