Re: [code][textadept] file filtering

From: Peter Rolf <indiego.att.gmx.net>
Date: Wed, 10 Apr 2019 11:07:21 +0200

Am 09.04.2019 um 17:50 schrieb Mitchell:
> Hi Peter,
>
> On Tue, 9 Apr 2019, Peter Rolf wrote:
>
>> Hi Mitchell,
>>
>> I am using "lfs.dir_foreach()" to scan a directory tree for "*.json"
>> files. This works fast and reliable, but the lack of an include
>> parameter for file filtering forces me to exclude all other existing
>> file types by listing them in the filter.
>>
>> [snip]
>
> I'm not sure what's going wrong. When I open the Lua command entry and
> enter:
>
>   lfs.dir_foreach(_HOME, print, {'.lua', '/core'})
>
> Textadept prints out .lua files in /core, but not those in /modules or
> /themes, nor does it print out the other files like .png, .conf, .luadoc
> in /core.
>
> To me this appears to be functioning properly.
>
> Granted, I am using a post 10.3 nightly build, but I don't think any
> filter code has changed since 10.3 itself.
>
> Do you have a simple file tree that you can submit, along with your
> filter, that demonstrates the issue so that I can debug? Thanks.
>

Sorry, no simple file tree available. More the opposite (30.5G, 32928
file in 3391 directories).

Anyhow, I tested a bit and just ".json" as filter works fine. But as
soon as I add exclusive directories it breaks. You can try this with

lfs.dir_foreach(_HOME, print, {'.lua', '!/core'})

which just lists "init.lua" here (ignoring all other sub directories,
not only "core"). Maybe I have missed something in the syntax...

Cheers, Peter

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 10 Apr 2019 - 05:07:21 EDT

This archive was generated by hypermail 2.2.0 : Wed 10 Apr 2019 - 06:45:47 EDT