Carrooi / Node-FsMock

[ABANDONED] Mock for fs module
MIT License
7 stars 2 forks source link

lstat/lstatSync throws an error when called on a non-symbolic link #14

Closed eugirdor closed 9 years ago

eugirdor commented 9 years ago

As seen here an error is thrown if you attempt to lstat() a file that is not a symbolic link. That doesn't appear to be the correct behavior. According to the fs.lstat documentation:

Asynchronous lstat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to.

The result for a non-symbolic link should be the same as stat().

I am not sure if this is an issue with any other method.