Closed eugirdor closed 9 years ago
Hello and thanks, do you want to create a pull request?
I don't have a fix for the issue currently. Somewhere in the code it needs to check if the path sans the trailing '/' exists and that it is a directory. If it is not a directory (i.e. /var/ww/index.php/
) it needs to throw an ENOTDIR
error, which does not happen either right now, you always get ENOENT
instead.
I think the fix might need to be in two places, the way the code is structured right now. existsSync
to fix the test I posted, but also in realpathSync
to throw the appropriate error.
What do you think?
Those should probably be two separate pull requests. The issue with the wrong error being thrown is kind of moot until #12 gets fixed.
Under the posix implementation (haven't tested Windows), any methods that work with directories do not work if the path contains a trailing '/'.
Given the two tests:
Passes
/var/www
:Fails
/var/www/
: