forked from haskell/directory
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop trailing path separators in
getPermissions
on Windows
This fixes the issue haskell#9 where Windows fails to recognize paths that contain trailing path separators.
- Loading branch information
1 parent
abfa69b
commit 3e56351
Showing
2 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import System.Directory | ||
|
||
main = do | ||
#ifndef mingw32_HOST_OS | ||
let exe = ".exe" | ||
#else | ||
let exe = "" | ||
#endif | ||
p <- getPermissions "." | ||
print p | ||
p <- getPermissions "getPermissions001.hs" | ||
print p | ||
#ifndef mingw32_HOST_OS | ||
p <- getPermissions "getPermissions001" | ||
#else | ||
p <- getPermissions "getPermissions001.exe" | ||
#endif | ||
p <- getPermissions ("getPermissions001" ++ exe) | ||
print p | ||
|
||
-- issue #9: Windows doesn't like trailing path separators | ||
_ <- getPermissions "../tests/" |