typicode / steno

Super fast async file writer with atomic write ⚡
MIT License
678 stars 40 forks source link

realpathSync causes error #15

Closed rinick closed 3 years ago

rinick commented 4 years ago
Error: ENOENT: no such file or directory, lstat 'C:\projects\xxx\a.json'
    at Object.realpathSync (fs.js:1545:7)
    at new Writer (C:\projects\xxx\node_modules\steno\index.js:13:18)

I think this error is caused by https://github.com/typicode/steno/pull/14 revert to previous version fixed the error.

rinick commented 4 years ago

also I think follow symlinks is a pretty weird behavior for a library that handles file writing.

1) if you know it's a symlink, you can always get the real path before calling writeFile 2) if you don't know whether it's a symlink or not, how do you know you should or should not follow the symlink? 3) And MOST IMPORTANT, it's no longer a drop-in replacement to fs.writeFile(), and can cause unexpected behavior.

typicode commented 3 years ago

also I think follow symlinks is a pretty weird behavior for a library that handles file writing.

You're right. Reverted in v1.0.0. Thanks for the feedback!