thecodrr / fdir

⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
https://thecodrr.github.io/fdir/
MIT License
1.46k stars 51 forks source link

Problem with double Backslash on Windows #93

Closed muehlich86 closed 10 months ago

muehlich86 commented 12 months ago

I cannot use the latest version because of the following change. For example, in Windows I have the following network path:

\\192.168.1.10\folder1\folder2

The following code also replaces the first \\ to a \.

\192.168.1.10\folder1\folder2

This will then not find any files.

I am currently using the following code. await new fdir().withMaxDepth(1).withFullPaths().crawl('\\192.168.1.10\folder1\folder2').withPromise();

https://github.com/thecodrr/fdir/blob/7185259ac31143573d7897fe8915cead681e838e/src/utils.ts#L15

The new option withPathSeparator(separator: "/" | "\") has the same effect.