Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Fastest way to count # of files?
- X-seq: zsh-users 21853
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Fastest way to count # of files?
- Date: Thu, 8 Sep 2016 09:08:00 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=GYGyHYUbEKOL7JNuWiXxNQywH68qPmmsaX8xLWe+zxc=; b=pstq/wqFc5B9+HJxzeYkG/F51uGT1U8q86CIafa/V4c/Sop/0681YU+jiex6SD7LQH /j9llOpKDjFUihWzbP9F5c+brRkJ4K1U8tpNc9j8jlvVm0NdFEbZumCt1ROnwG4lWLUB UGeMjJwXmI/QJ6uBrG4U4fU1WULpazAgsg3DBs6C0YpS3WJZnsi/c5MeEQiteNhs6s1X V4Hgv5tz/U3kUahR6TYxucuZSogA0fCElwL61jpqZwP9Rl0FUoaVnpZUp/CklRNZNd1d 3lVPjpXeBX3sZDybYmOJ48EOtoiCDBJtmGWpOISIS1gumSVquVj4rGfIpyR6mq37X923 snqg==
- In-reply-to: <CAKc7PVApZGBAoQ4GywTLzbJXmNOrq2-W_iP7p+ifWqzYF49N+g@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVApZGBAoQ4GywTLzbJXmNOrq2-W_iP7p+ifWqzYF49N+g@mail.gmail.com>
On Sep 8, 5:36pm, Sebastian Gniazdowski wrote:
}
} [...] The second code reads the whole directory too, but
} it's slow. First code doesn't provide way to determine # of files
} read. Is there anything between these two? Something that doesn't
} store files, but counts them?
Try this:
integer nfiles=0
: **/*(Ne?'((++nfiles)) && reply=()'?)
print $nfiles
Messages sorted by:
Reverse Date,
Date,
Thread,
Author