TotallyInformation / node-red-contrib-fs

Node-Red node template for host filing system handling
Apache License 2.0
14 stars 6 forks source link

File pattern not working in a sub-folder in version 1.1.1 #13

Closed fabnavigator closed 4 years ago

fabnavigator commented 4 years ago

Hi,

I recently upgraded to version 1.1.1 and my code is no longer working.

My folder structure is "/data/json/minimote".

When my start folder is "/data/json", the file pattern is "*", and the max search depth is "1", it returns all files in the "minimote" sub-folder.

When my start folder is "/data/json/minimote", the file pattern is "MM*", and the max search depth is "1", it returns all the files starting with "MM" in the "minimote" sub-folder.

When my start folder is "/data/json", the file pattern is "MM*", and the max search depth is "1", it returns no files.

I also noted that the information for the node says there is a "Search sub-folders Checkbox". I don't see that checkbox in my node.

Thanks,

Bill

rcarmo commented 4 years ago

I have the same experience. No "Search sub-folders" checkbox.

juggledad commented 4 years ago

The problem is that in the current release, the 'pattern' is used as both a file AND folder pattern. so in your case it is looking for all files starting with 'MM in folders that start with 'MM'.

I'm working on PR to add a separate folder/directory option (and fix/add some other features) so you could add in this new option 'mini' and it would look for files starting with 'MM' in folders starting with 'mini' or leave it as the default ('') and it would look for all files starting with 'MM' in all the sub-folders for the depth specified.

Hopefullw it will be done in a couple days.

TotallyInformation commented 4 years ago

Took a little more than a few days :) But I've just accepted Paul's PR and will be publishing this as v1.2.0 shortly.

A quick test shows that your problem should now be fixed.