Re: NSFileWrapper serializedRepresentation bloat?
Re: NSFileWrapper serializedRepresentation bloat?
- Subject: Re: NSFileWrapper serializedRepresentation bloat?
- From: Matt Gough <email@hidden>
- Date: Mon, 10 Jan 2011 08:56:01 +0000
Not sure its related, but I have noticed that using Finder nowadays to create an alias of a plain folder results in a 1MB alias file. Seems its also stashing away a copy of the plain folder icon. (Actually it is stashing two copies, one in the resource fork for compatibility and one in the data fork.)
It doesn't do this when creating aliases of files.
On 10 Jan 2011, at 07:40:05, email@hidden wrote:
> Problem ID: 8840391
>
> _murat
>
> On Jan 8, 2011, at 7:55 PM, Ken Ferry wrote:
>
>> Hi,
>>
>> That's what I see too. From inspecting the serialized rep, it looks like it's icon data.
>>
>> Since at least in my test case the folders did not have custom icons, it seems like one could do better. Could you file a bug please?
>>
>> -Ken
>> Cocoa Frameworks
>>
>> On Sat, Jan 8, 2011 at 5:16 PM, email@hidden <email@hidden> wrote:
>> I create an NSFileWrapper for a directory hierarchy like this (all items are directories, no files):
>>
>> test-dir/
>> test-dir/inner-dir-a
>> test-dir/inner-dir-b
>> test-dir/inner-dir-c
>>
>> The wrapper's serialized representation weighs in at around an astounding 1mB (1,022,234 bytes)!
>>
>> Seems that the overhead per folder is around 300kB. Can that be right?
>>
>> Code:
>>
>> NSURL* url = [NSURL fileURLWithPath:@"/User/foo/Desktop/test-dir"];
>> NSFileWrapper w = [[NSFileWrapper alloc] initWithURL:url options:0 error:nil];
>>
>> NSData* data = [w serializedRepresentation];
>>
>> NSLog(@"%d", [data length]);
>>
>>
>> _murat
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden