# Files without extension are not listed (node-red-contrib-fs)

**URL:** <https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308>\
**Category:** General\
**Created:** [12 July 2021 11:26 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308 "2021-07-12T11:26:01Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![softy2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/softy2k/32/23707_2.png) [@softy2k](https://discourse.nodered.org/u/softy2k)\
**Post date:** [12 July 2021 11:26 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/1 "2021-07-12T11:26:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2021 11:31 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/2 "2021-07-12T11:31:35Z")

</div>

What are the settings you are using in the node?

---

<div class="post-metadata">

**Author:** ![softy2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/softy2k/32/23707_2.png) [@softy2k](https://discourse.nodered.org/u/softy2k)\
**Post date:** [12 July 2021 11:39 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/3 "2021-07-12T11:39:41Z")

</div>

I tried several : `*.*` , `*`

Config generated by **[node-red-contrib-fs](https://github.com/TotallyInformation/node-red-contrib-fs)**

```auto
{
	"start": "C:/Delete",
	"pattern": "*.*,.*.*",
	"folders": "*,.*",
	"lstype": "files",
	"hidden": true,
	"path": true,
	"single": true,
	"depth": 0,
	"stat": true
}

```

 ![FS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03c689ce7db79d6d59667cad2e2881e48f3a66af.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2021 12:03 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/4 "2021-07-12T12:03:46Z")

</div>

Yup I see the problem and note you have added to an existing issue on the GitHub page. If I get some time later today, I'll take a peek in the code.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 July 2021 14:39 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/5 "2021-07-12T14:39:23Z")

</div>

Thanks. I've not found much time for that node recently. All contributions gratefully received 🙂

A file pattern of `*.*` probably wouldn't work of course since it is asking for something with a dot in it. Did you try a file pattern of `*`.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 July 2021 15:21 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/6 "2021-07-12T15:21:35Z")

</div>

> [@softy2k](#):
>
> I tried several : `*.*` , `*`

Did you try just `*`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2021 15:25 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/7 "2021-07-12T15:25:36Z")

</div>

@Colin in my testing, the only way to list a file with no extension is using the first letter on the file name and an asterisk.

I be looking at the code later today since I dug into it last year.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 July 2021 15:49 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/8 "2021-07-12T15:49:14Z")

</div>

OK, I didn't realise you had replicated it with just a `*`. As you say it does seem there is a bug then.

---

<div class="post-metadata">

**Author:** ![softy2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/softy2k/32/23707_2.png) [@softy2k](https://discourse.nodered.org/u/softy2k)\
**Post date:** [12 July 2021 19:20 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/9 "2021-07-12T19:20:01Z")

</div>

**Julian** , please add time formatting in milliseconds (same as in **fs-ops-stats** ).  
It would simplify the flow, no need for conversion.

![Times](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/433d3d4b112a18850dd4598a46bcdb672b8cd07d.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2021 19:30 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/10 "2021-07-12T19:30:25Z")

</div>

I have a question for you. Lets say you have the following files  
 ![Screen Shot 2021-07-12 at 3.21.57 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/db88283676818d13c6eb946da64ebc36ad1d8c60.png)

What do you think the correct search pattern should be to just return the file `noext`?

---

<div class="post-metadata">

**Author:** ![softy2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/softy2k/32/23707_2.png) [@softy2k](https://discourse.nodered.org/u/softy2k)\
**Post date:** [12 July 2021 19:31 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/11 "2021-07-12T19:31:52Z")

</div>

For me, for all files : `*.*`  
With no extension, I think `*` or `*.`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2021 20:05 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/12 "2021-07-12T20:05:15Z")

</div>

hmmm, in Linux using  
`*.*` lists all the non hidden files and no folders  
`*.` generates an error  
`*` lists all non hidden files and folders and their contents

so being consistant with Linux, it should be `*` and you would have to filter out the ones you don't want,,,,hmmm

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 July 2021 23:25 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/13 "2021-07-12T23:25:19Z")

</div>

Ah, that explains why I put in the test for '' or '_' and convert both to '_.\*' because that is looking for FILES not folders which is separate.

So I think something more complex is needed in order to be able to search just for files even if they don't have an extension - and it needs to work on both Windows and Linux.

I am open to suggestions 🙂

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 July 2021 23:27 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/14 "2021-07-12T23:27:37Z")

</div>

I think I'm just returning what Node.JS's fs library gives aren't I?

I'm open to a PR though.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2021 09:05 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/15 "2021-07-13T09:05:08Z")

</div>

One thing you can do is use a single `*` and return the results in separate messages. Then add a `switch` set up to look and see if the file 'contains' a period like this  
 ![Screen Shot 2021-07-13 at 5.03.59 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a72eb300df9b3f9cafda701769806b844051809a.png)  
and only pass on what comes out of the 'otherwise'

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 July 2021 12:59 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/16 "2021-07-14T12:59:23Z")

</div>

In bash one can do `ls -d !(*.*)` which says to only show files without a dot in the name. I suspect that doesn't help here however.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [14 July 2021 13:58 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/17 "2021-07-14T13:58:08Z")

</div>

There is a handy npm package which deals very well with pattern matching, and also claims to be Windows compliant.

> **[micromatch](https://www.npmjs.com/package/micromatch)**
>
> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 September 2021 11:17 UTC](https://discourse.nodered.org/t/files-without-extension-are-not-listed-node-red-contrib-fs/48308/19 "2021-09-15T11:17:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
