javascript - Node.js check if path is directory error -


i'm trying use this answer allow me check if given file path directory, following error:

fs.js:679   return binding.lstat(pathmodule._makelong(path));                  ^ error: enoent, no such file or directory '.ds_store'     @ object.fs.lstatsync (fs.js:679:18) 

i figured maybe couldn't handle hidden files well, so, after failing find more elegant solution, checked if first character in file name '.'. however, program crashed on file:

fs.js:679   return binding.lstat(pathmodule._makelong(path));                  ^ error: enoent, no such file or directory 'readme.md'     @ object.fs.lstatsync (fs.js:679:18) 

why fs.lstatsync() seem error such common files, , how can make work (correctly evaluate if given path directory)?


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -