Ticket #1874 (closed bug: fixed)
getDirectoryContents yields "invalid argument" instead of "permission error"
|Reported by:||Orphi||Owned by:|
|Type of failure:||None/Unknown||Difficulty:||Moderate (less than a day)|
|Test Case:||getDirectoryContents "C:\\System Volume Information"||Blocked By:|
Attempting to open a file (readFile, openFile, et al) to which you do not have permission yields a permission exception. However, calling getDirectoryContents on a folder to which you do not have permission yields an "invalid argument" exception.
(Note that as per bug #1868, this particular exception is very hard to process.)
This behaviour occurs in GHC 6.6.1 and GHC 6.8.1 running on Windows XP. (I think I recall it also happening in GHC 6.6 on Windows NT as well, but I might be imagining that part.)