LIB/GTK: add move menuitem and implement creating new files

This commit is contained in:
2015-12-25 22:51:45 +01:00
parent c98db302ba
commit 71a2cb90be
8 changed files with 153 additions and 4 deletions

View File

@@ -63,6 +63,7 @@ data FmIOException = FileDoesNotExist String
| NotAFile String
| NotADir String
| DestinationInSource String String
| FileDoesExist String
| DirDoesExist String
| IsSymlink String
deriving (Show, Typeable)
@@ -87,6 +88,11 @@ throwNotAbsolute :: FilePath -> IO ()
throwNotAbsolute fp = unless (isAbsolute fp) (throw $ PathNotAbsolute fp)
throwFileDoesExist :: FilePath -> IO ()
throwFileDoesExist fp =
whenM (doesFileExist fp) (throw $ FileDoesExist fp)
throwDirDoesExist :: FilePath -> IO ()
throwDirDoesExist fp =
whenM (doesDirectoryExist fp) (throw $ DirDoesExist fp)