Re: Download fileSystem data
Re: Download fileSystem data
- Subject: Re: Download fileSystem data
- From: Leonardo <email@hidden>
- Date: Sat, 30 Nov 2013 15:00:51 +0100
- Thread-topic: Download fileSystem data
Thank you Ken.
That sounds really promising. I will tell you about the results. With the
old and the new method. Thanks!
Regards
-- Leonardo
Da: "Stephen J. Butler" <email@hidden>
Data: Sat, 30 Nov 2013 04:08:23 -0600
A: Leonardo <email@hidden>
Cc: Cocoa Development <email@hidden>
Oggetto: Re: Download fileSystem data
Have you profiled your code to see what calls exactly are taking the most
time? I have a feeling it's these:
isFilePackageAtPath
kLSItemInfoIsInvisible
kFSNodeLockedMask
kFSCatInfoCreateDate
kFSCatInfoContentMod
kFSCatInfoBackupDate
kFSCatInfoAccessDate
And parsing "ls" output won't get you these (besides, parsing "ls" is a
dirty hack anyway). You probably want to try dropping down to
CFURLEnumerator and asking it to prefetch the desired attributes. Or, if
you're targeting pre-10.6 then FSGetCatalogInfoBulk().
On Sat, Nov 30, 2013 at 3:40 AM, Leonardo <email@hidden> wrote:
> Hi,
> actually I ask a remote machine for
> contentsOfDirectoryAtPath
> Then for each file I ask for
> attributesOfItemAtPath
> And check the NSFileType to verify whether the file is
> NSFileTypeDirectory
> NSFileTypeRegular
> NSFileTypeSymbolicLink
> Then I check
> isFilePackageAtPath
> kLSItemInfoIsInvisible
> kFSNodeLockedMask
> kFSCatInfoCreateDate
> kFSCatInfoContentMod
> kFSCatInfoBackupDate
> kFSCatInfoAccessDate
>
> These queries take a long time on a remote machine.
> Is a faster way to get all of that? I thought to use a Terminal command
> throughan NSTask (e.g. "ls -la" plus other options), but honestly I don't
> know how to filter the query and get the smallest necessary data. Any hint?
>
>
>
> Regards
> -- Leonardo
>
>
> _______________________________________________
>
> 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
> <http://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