Re: Faster way to prune directory?

2015-04-15 Thread Bernhard Voelker
On 04/16/2015 06:04 AM, Peng Yu wrote: > Hi, The following code shows that -prune when used with -exec can be > very slow. Is there somehow a way to speed this up? > > ~$ cat main.sh > #!/usr/bin/env bash > > tmpdir=$(mktemp -d) > > function mkalotdir { > local n=$1 > local i > local j > local k

Re: Allow `find` to use exported function for -exec*?

2015-04-15 Thread Eric Blake
On 04/15/2015 08:50 PM, Peng Yu wrote: > Hi, It seems that it might be convenient to allow `find` to use > exported functions from shell for -exec*? Can this feature be added in > the future? If your shell supports function exports, then the feature already exists. Merely export the function befo

Faster way to prune directory?

2015-04-15 Thread Peng Yu
Hi, The following code shows that -prune when used with -exec can be very slow. Is there somehow a way to speed this up? ~$ cat main.sh #!/usr/bin/env bash tmpdir=$(mktemp -d) function mkalotdir { local n=$1 local i local j local k for i in $(seq -w "$n") do for j in $(seq -w "$n") do fo

Allow `find` to use exported function for -exec*?

2015-04-15 Thread Peng Yu
Hi, It seems that it might be convenient to allow `find` to use exported functions from shell for -exec*? Can this feature be added in the future? -- Regards, Peng