Re: Bookmark alias files v. Finder alias files
On Apr 14, 2012, at 4:39 PM, Shane Stanley wrote: Thanks, Charles. I guess that makes it arguably a Finder bug. Nicely done, what was actually used on the resource forks out of curiosity? Really, on the arguably a bug? I suppose if your sole criteria is minimal size. Or maybe the criteria is age, where anything older is automatically buggy? If your criteria is best variety of icons, then current could be argued buggy since it only has one icon resource to the Finder's two. The correct argument would be if either doesn't actually function correctly as a file alias only then is it buggy, wouldn't it? Given that differences in size, icon support, or whatever, aren't really, truly, excessive. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On 15/04/2012, at 9:23 PM, Michael Hall wrote: If your criteria is best variety of icons, then current could be argued buggy since it only has one icon resource to the Finder's two. But the Finder really only has one, twice. -- Shane Stanley sstan...@myriad-com.com.au 'AppleScriptObjC Explored' www.macosxautomation.com/applescript/apps/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 15, 2012, at 7:36 AM, Shane Stanley wrote: On 15/04/2012, at 9:23 PM, Michael Hall wrote: If your criteria is best variety of icons, then current could be argued buggy since it only has one icon resource to the Finder's two. But the Finder really only has one, twice. the Finder has *two* such ‘icns’ resources; one with ID -16496 and one with ID -16455. The two ‘icns’ resources appear to be identical, Ah, I had remembered the two different id's but missed that the resources appear identical. If true possibly a bug. A little more checking... http://static.userland.com/Iowa/sourceListings/macbirdSource/Frontier%20SDK%204.1b1/Toolkits/Applet%20Toolkit/appletfilealias.c.html #define kCustomAliasIconID -16496 Mention of -16545 here for example http://www.cocoabuilder.com/archive/cocoa/15858-setting-file-icon.html Again this seems to relate to custom icon id's so it is still possibly a duplicate bug. But you also still might have to do more digging to be sure having both id's doesn't have some special meaning to the Finder that is arguably non-buggy? Maybe some situation where having both id's means the Finder will correctly use the right icon where without the second one it wouldn't. Possibly an archaic situation so the newer code can omit it but the Finder has never been updated to change the archaic behavior? But it might take more verifying to be sure of which. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Along these lines, I made an alias to one of my project files that was 48K. The alias is 668 K. W T F? What's the point of aliases if they are this fat? On Apr 15, 2012, at 8:57 AM, Michael Hall wrote: On Apr 15, 2012, at 7:36 AM, Shane Stanley wrote: On 15/04/2012, at 9:23 PM, Michael Hall wrote: If your criteria is best variety of icons, then current could be argued buggy since it only has one icon resource to the Finder's two. But the Finder really only has one, twice. the Finder has *two* such ‘icns’ resources; one with ID -16496 and one with ID -16455. The two ‘icns’ resources appear to be identical, Ah, I had remembered the two different id's but missed that the resources appear identical. If true possibly a bug. A little more checking... http://static.userland.com/Iowa/sourceListings/macbirdSource/Frontier%20SDK%204.1b1/Toolkits/Applet%20Toolkit/appletfilealias.c.html #define kCustomAliasIconID -16496 Mention of -16545 here for example http://www.cocoabuilder.com/archive/cocoa/15858-setting-file-icon.html Again this seems to relate to custom icon id's so it is still possibly a duplicate bug. But you also still might have to do more digging to be sure having both id's doesn't have some special meaning to the Finder that is arguably non-buggy? Maybe some situation where having both id's means the Finder will correctly use the right icon where without the second one it wouldn't. Possibly an archaic situation so the newer code can omit it but the Finder has never been updated to change the archaic behavior? But it might take more verifying to be sure of which. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com This email sent to z...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Allowing the user to move the original without disrupting references to it is the point, not space savings. On Apr 15, 2012, at 8:13 AM, Alex Zavatone wrote: What's the point of aliases if they are this fat? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Space savings definitely used to be one of the benefits. I wonder when that changed and why. On Apr 15, 2012, at 10:35 AM, Scott Ribe wrote: Allowing the user to move the original without disrupting references to it is the point, not space savings. On Apr 15, 2012, at 8:13 AM, Alex Zavatone wrote: What's the point of aliases if they are this fat? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 15, 2012, at 8:51 AM, Alex Zavatone wrote: Space savings definitely used to be one of the benefits. Space savings was *never* a reason to use a alias. In what reasonable scenario would you use aliases to save space??? I wonder when that changed and why. Previews maybe? I don't know why or even if, but maybe the Finder is stuffing a 512x512 preview in there? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 15, 2012, at 7:51 AM, Alex Zavatone wrote: Space savings definitely used to be one of the benefits. Perhaps you are confusing alias with symbolic link? They are not the same thing even though the finder displays them using the same icon. Marc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Well, thinking back to 1995, it appeared that they were exactly that. What Is the payload full of now, icons and previews or what? Sent from my iPod On Apr 15, 2012, at 1:10 PM, Scott Ribe scott_r...@elevated-dev.com wrote: On Apr 15, 2012, at 11:05 AM, Alex Zavatone wrote: Nope. I'm thinking back to 1995 when an alias was about 2K. But I don't want to clog the list up with this. It just seems strange that an alias now has to be so large a set of data structures. 668KB? Even if we are in the days of TB hard drives, that just seems insane. It does seem large. But still, aliases were never used for saving space. How exactly could they have been? An alias is not and never was a substitute for a copy. It has always been a (relatively) robust persistent reference, which is not in any way a substitute for a copy. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 15, 2012, at 12:36 PM, Alex Zavatone wrote: Well, thinking back to 1995, it appeared that they were exactly that. What Is the payload full of now, icons and previews or what? Sent from my iPod Um, yes, as has already been mentioned, aliases store the icons of their target files, and in Lion, icons can be pretty big. Try making a Finder alias of a generic document, a folder, or something else that has a 1024x1024 icon. The alias will be over a meg in size. Yes, that’s bigger than back in 1992. Unsurprisingly, a 1024x1024 32-bit color icon takes up more space than a 32x32 256-color icon. Progress marches on. The one thing that could probably be changed would be to have Finder aliases store only one copy of the icon instead of two. Still, however, I’m not going to lose any sleep over it. This would have been a big deal back when a 128 MB hard drive was huge, but not so much today. At any rate, this discussion has drifted pretty far off topic and should probably be closed at this point. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Sorry if I overlooked that. In and out of Xcode right now. Yeah, I always remembered them as pointers to files. It seems like terrible overkill to embed the fat data in the aliases. The point that I was trying to make which obviously was not obvious is that if a screenshot saved out of the iOS Simulator is 44KB and the alias is 340 KB, then something is wrong. The PNG file does not contain a load of data for its icon and the like, so it seems terrible that the alias must. It would seem that the alias should be able to resolve the location of the icon and use the original, or use a default file type icon representation if that lookup fails. In any case, back to work. On Apr 15, 2012, at 1:46 PM, Charles Srstka wrote: On Apr 15, 2012, at 12:36 PM, Alex Zavatone wrote: Well, thinking back to 1995, it appeared that they were exactly that. What Is the payload full of now, icons and previews or what? Sent from my iPod Um, yes, as has already been mentioned, aliases store the icons of their target files, and in Lion, icons can be pretty big. Try making a Finder alias of a generic document, a folder, or something else that has a 1024x1024 icon. The alias will be over a meg in size. Yes, that’s bigger than back in 1992. Unsurprisingly, a 1024x1024 32-bit color icon takes up more space than a 32x32 256-color icon. Progress marches on. The one thing that could probably be changed would be to have Finder aliases store only one copy of the icon instead of two. Still, however, I’m not going to lose any sleep over it. This would have been a big deal back when a 128 MB hard drive was huge, but not so much today. At any rate, this discussion has drifted pretty far off topic and should probably be closed at this point. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
Or, at least, the preview should not take more space than the image file ;-) On Apr 15, 2012, at 11:51 AM, Alex Zavatone wrote: The PNG file does not contain a load of data for its icon and the like, so it seems terrible that the alias must. It would seem that the alias should be able to resolve the location of the icon and use the original, or use a default file type icon representation if that lookup fails. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 13, 2012, at 6:54 PM, Shane Stanley wrote: When I look in the Finder, a Finder-created alias of the same file is listed as 144KB, while the one I saved is 96KB. I'm curious about what's in that extra 48KB. I had a look in Terminal and got this: Shanes-iMac:~ shane$ ls -laoO /Users/shane/Desktop/untitled\ folder total 496 drwxr-xr-x5 shane - 170 14 Apr 08:44 . drwx--@ 310 shane - 10540 14 Apr 08:44 .. -rw-r--r--@ 1 shane - 6148 14 Apr 08:44 .DS_Store -rw-r--r--@ 1 shane - 48296 13 Apr 22:16 key path samples copy.scpt alias 5 -rw-r--r--@ 1 shane - 48360 13 Apr 22:31 key path samples copy.scpt alias 6 IOW, there's only 64 bytes difference between them -- meanwhile another 48KB seems unaccounted for. Does anyone have an explanation? The Finder-created one probably has a resource fork with additional data. That accounts for the size difference that isn't visible using ls. Off-hand, I don't know what the resource fork data holds. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On 14/04/2012, at 6:23 PM, Ken Thomases wrote: The Finder-created one probably has a resource fork with additional data. That accounts for the size difference that isn't visible using ls. Off-hand, I don't know what the resource fork data holds. How do I see the resource forks, if not with ls? And that still leaves 48KB unaccounted for, in that Terminal shows them both as ~48KB, whereas Finder says one is 96KB and the other is 144KB. So if it is a resource fork issue, one has a 48KB resource fork, and the other 96KB. Seems odd to me. And the original file was only about 10KB... -- Shane Stanley sstan...@myriad-com.com.au 'AppleScriptObjC Explored' www.macosxautomation.com/applescript/apps/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 14, 2012, at 4:40 AM, Shane Stanley wrote: On 14/04/2012, at 6:23 PM, Ken Thomases wrote: The Finder-created one probably has a resource fork with additional data. That accounts for the size difference that isn't visible using ls. Off-hand, I don't know what the resource fork data holds. How do I see the resource forks, if not with ls? You can see the names and sizes of extended attributes, of which the resource fork is one, using ls -@. You can read the extended attribute using xattr. You can also access the resource fork as a file by appending /..namedfork/rsrc to the path. du -h shows me the total file size. That includes the resource fork and it also accounts for the block size. That is, it's really showing the disk space used, the physical size, not just the logical size of the file. Also, keep in mind that Apple switched some time ago to using powers of 10 for disk space units. So, in the Finder, KB == 1,000 bytes, not 1,024 bytes. Some of the command line tools still powers of 2, depending on options. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 14, 2012, at 5:05 AM, Ken Thomases wrote: You can also access the resource fork as a file by appending /..namedfork/rsrc to the path. Ken beat me to it after I found this... Work with resource forks in the Terminal http://hints.macworld.com/article.php?story=2002022409532098 Ken could very well be right that it is using the resource fork in one instance and not the other. I think for file alias's it actually stuck a 'alis' AppleEvent in the resource fork? For example from http://en.wikipedia.org/wiki/Resource_fork Name of resource type (actual name) Description alis (alias)Stores an alias to another file, in a resource fork of a file whose alias attribute bit is set One thing I was wondering about was that I remembered working on this code for open document handling... if ( dirObjType == typeAlias) { // 'alis' ) {// open one file } else if ( dirObjType == typeAEList) { // 'list' ) { // open many files aliasHandle = (AliasHandle)NewHandle( 0L ); // get a real Handle; we'll resize as needed. if ( NULL != aliasHandle ) { int numItems = [dirObj numberOfItems]; docs = [[NSMutableArray alloc] initWithCapacity:numItems]; for ( i = 1; i = numItems; i++ ) { NSAppleEventDescriptor *thisAlias = [dirObj descriptorAtIndex:i]; if ([thisAlias descriptorType] != typeAlias) // 10.6 bmrk? thisAlias = [thisAlias coerceToDescriptorType:typeAlias]; At 10.6 I found that multiple open files started using the bmrk AppleEvent type that I coerced to typeAlias 'alis'. while a single file still used the 'old' typeAlias. Seeing yours I wondered if that might apply somehow. Yours using the 'bmrk' type written to either the data or resource fork while the Finder still uses 'alis' to the resource fork? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Apr 14, 2012, at 7:11 AM, Shane Stanley wrote: Thanks Ken and Michael. So the Finder-generated alias has a ~96KB resource fork, and the bookmark-generated one has a 48KB resource fork. On comparing them, it looks like the first ~48KB are identical apart from the first and last few bytes -- and the second 48KB of the Finder-generated one is also the same as the first 48KB except for small sections at the beginning and end. I did a quick google out of curiosity and there doesn't appear to be much available anymore to handle actually looking at or working with resource forks. If you can examine contents you could scan for the AppleEvent id's 'alis' or 'bmrk'. You should of course also see a file name in there somewhere. I'm not sure what other overhead there might be, length's maybe? If I had to guess the Finder is writing copies to both the resource and data forks. Are you sure the ~96KB isn't both forks? I can't think of a reason to write it twice to the same fork. But I don't think that I ever dissected one. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On 14/04/2012, at 11:28 PM, Michael Hall wrote: I did a quick google out of curiosity and there doesn't appear to be much available anymore to handle actually looking at or working with resource forks. If you can examine contents you could scan for the AppleEvent id's 'alis' or 'bmrk'. You should of course also see a file name in there somewhere. I'm not sure what other overhead there might be, length's maybe? The overwhelming bulk of the data seems to be repeated. If I had to guess the Finder is writing copies to both the resource and data forks. Are you sure the ~96KB isn't both forks? Yes: Shanes-iMac:~ shane$ ls -@l /Users/shane/Desktop/untitled\ folder total 480 -rw-r--r--@ 1 shane shane 48296 14 Apr 21:55 key path samples copy.scpt alias 5 com.apple.FinderInfo 32 com.apple.ResourceFork 95212 -rw-r--r--@ 1 shane shane 48360 13 Apr 22:31 key path samples copy.scpt alias 6 com.apple.FinderInfo 32 com.apple.ResourceFork 47976 -- Shane Stanley sstan...@myriad-com.com.au 'AppleScriptObjC Explored' www.macosxautomation.com/applescript/apps/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On Sat, 14 Apr 2012 08:28:20 -0500, Michael Hall said: I did a quick google out of curiosity and there doesn't appear to be much available anymore to handle actually looking at or working with resource forks. There's this: https://github.com/nathanday/ndalias/blob/master/Classes/NDResourceFork.h -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bookmark alias files v. Finder alias files
On 15/04/2012, at 3:26 AM, Charles Srstka wrote: the Finder has *two* such ‘icns’ resources; one with ID -16496 and one with ID -16455. The two ‘icns’ resources appear to be identical, and if I subtract the size of one of them from the Finder alias’s size, I get the size of the NSURL-created alias. So I’d guess that the duplicate icon resources are the reason for the discrepancy you’re seeing, and the alias files you’re creating with NSURL aren’t lacking any important information. Thanks, Charles. I guess that makes it arguably a Finder bug. -- Shane Stanley sstan...@myriad-com.com.au 'AppleScriptObjC Explored' www.macosxautomation.com/applescript/apps/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com