Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
`findFile` edges case with absolute paths on Windows #72
The examples below where
referenced this issue
Feb 27, 2017
What do you consider the correct behavior to be? The documentation is rather underspecified currently.
I double-checked the results on my Linux system and there is at least one inconsistency between platforms that needs to be remedied:
Proposed invariant: If
Currently these two cases from above violate the proposed invariant on Windows.
I expect the first to return
The slash type is significant in Linux (tested on Ubuntu 16.04). May be affecting the results you're seeing.
In any case, I recommend the same invariant.
Oh, sorry, it seems I have misread. I thought there was a discrepancy between Windows and Linux, but that was a mistake on my part.
It seems the behavior that you are proposing concerns solely with regard to cases where the first argument is
I feel like the first behavior may have been accidental and not part of the original API: it only worked because
In isolation, the first behavior is quite absurd, so I think a compromise would be:
isAbsolute p ==> findFile  p == bool (Just p) Nothing <$> doesFileExist p
This should minimize the effect on most code except those that rely on