isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
477 stars 47 forks source link

ENOENT when calling stat on directory with slash at the end #13

Closed jcubic closed 5 years ago

jcubic commented 5 years ago

I'm trying to use my old service worker for server like file access but it don't work with lightingFS because:

fs.stat('/foo/', (e) => { console.log(e)});

show error:

ENOENT: /foo/

the directory exists because fs.stat('/foo', ...) is working fine.

I need this to be working because I'm distinguishing directories from files using slash at the end of the directory. Probably my worker can be refactored but it would be nice if the library work the same as Node fs.

billiegoose commented 5 years ago

it would be nice if the library work the same as Node fs.

node's path module does a LOT of crazy things... and I intentionally kept my path.js module extremely lean. Buuuut I think we can squeeze in this little feature. :)

jcubic commented 5 years ago

I think that issue can be closed. Need to retest.