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.
Merge pull request haskell#8 from gintas/master
- Loading branch information
Showing
5 changed files
with
43 additions
and
7 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 |
---|---|---|
|
@@ -23,3 +23,4 @@ | |
/getPermissions001 | ||
/renameFile001 | ||
/renameFile001.tmp1 | ||
/T8482 |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import System.Directory | ||
import Control.Exception | ||
|
||
tmp1 = "T8482.tmp1" | ||
testdir = "T8482.dir" | ||
|
||
main = do | ||
writeFile tmp1 "hello" | ||
createDirectory testdir | ||
tryRenameFile testdir tmp1 >>= print -- InappropriateType | ||
tryRenameFile tmp1 testdir >>= print -- InappropriateType | ||
tryRenameFile tmp1 "." >>= print -- InappropriateType | ||
removeDirectory testdir | ||
removeFile tmp1 | ||
where tryRenameFile :: FilePath -> FilePath -> IO (Either IOException ()) | ||
tryRenameFile opath npath = try $ renameFile opath npath |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Left T8482.dir: renameFile: inappropriate type (is a directory) | ||
Left T8482.dir: renameFile: inappropriate type (is a directory) | ||
Left .: renameFile: inappropriate type (is a directory) |
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