Files without extension are not listed, even with file pattern "*"
ChrisFromMcAfee opened this issue · comments
Software and Package Versions
Software | Version |
---|---|
Node.JS | |
npm | 7.18.1 |
Node-RED | 1.3.5 |
fs node | 1.4.1 |
OS | CentOS 7 |
Browser | Chrome |
How is Node-RED installed? Where is uibuilder installed?
Local install based on node-red website readme.
Hi!
I have a small project where I extract a file and use this node to look up all the extracted files. Now when I use file pattern . it will not pick up filenames without an extension. Now when I change the file pattern to "*", it does not detect them as well, which not ideal on a linux system and to get an accurate number of files in a folder. Is there another way to create the pattern or something wrong with the logic of the node?
Thanks!
Chris :)
I just went through the code and found this
if ( (node.pattern == '') || (node.pattern == '*') ) node.pattern = '*.*'
for the file-lister. I guess that explains why setting it to "*" automatically is reset to .. Is there a specific reason for that?
(sorry, I am a github newb, so please excuse my lack of formatting)
Same issue for me : Files without extension are not listed
Info :
- Windows 10
- NodeRed 1.3.5 and 2 beta 2
- NodeJs 14.17.3
- Npm 7.19.1
- Chrome
I'm sure there was an original reason for that code but I don't remember why now. Did you try amending the code manually?
I modified the code to read
if (node.pattern == '') node.pattern = '*'
It works fine now.