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 <mac.iphone....@gmail.com> 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 (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/stephen.butler%40gmail.com
>
> This email sent to stephen.but...@gmail.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

Reply via email to