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
Post a Comment