Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files without extension are not listed, even with file pattern "*" #24

Open
ChrisFromMcAfee opened this issue Jun 24, 2021 · 4 comments

Comments

@ChrisFromMcAfee
Copy link

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 :)

@ChrisFromMcAfee
Copy link
Author

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)

@softy2k
Copy link

softy2k commented Jul 12, 2021

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

@TotallyInformation
Copy link
Owner

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?

@jmorris644
Copy link

I modified the code to read

if (node.pattern == '') node.pattern = '*'

It works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants