Saturday 7 September 2019

fs.readdir failing on and don't know why

Running a node app to read a directory

fs.readdirSync('‎/Users/edwardthompson/Dropbox/Apps/EvidentiaSoftware/records/thompson-hayward');

I consistently get

 Stack:
    error properties: Object({ errno: -2, syscall: 'scandir', code: 'ENOENT', path: '‎/Users/edwardthompson/Dropbox/Apps/EvidentiaSoftware/records/thompson-hayward' })
    Error: ENOENT: no such file or directory, scandir '‎/Users/edwardthompson/Dropbox/Apps/EvidentiaSoftware/records/thompson-hayward'

But I know the directory is there

ls -al /Users/edwardthompson/Dropbox/Apps/EvidentiaSoftware/records/thompson-hayward
    total 0
    drwxr-xr-x@ 9 edwardthompson  staff  288 Jan 18  2019 .
    drwxr-xr-x@ 6 edwardthompson  staff  192 Aug 29 12:30 ..
    drwxr-xr-x@ 9 edwardthompson  staff  288 Jan 18  2019 Births
    drwxr-xr-x@ 4 edwardthompson  staff  128 Jan 18  2019 Census
    drwxr-xr-x@ 3 edwardthompson  staff   96 Jan 18  2019 Deaths
    drwxr-xr-x@ 7 edwardthompson  staff  224 Jan 18  2019 Marriages
    drwxr-xr-x@ 4 edwardthompson  staff  128 Jan 18  2019 Military
    drwxr-xr-x@ 3 edwardthompson  staff   96 Jan 18  2019 Other
    drwxr-xr-x@ 8 edwardthompson  staff  256 Jan 18  2019 books

Not sure how to proceed



from fs.readdir failing on and don't know why

No comments:

Post a Comment