LIB: improve symlink handling
This commit is contained in:
@@ -115,6 +115,10 @@ open row mygui myview =
|
||||
del :: Row -> MyGUI -> MyView -> IO ()
|
||||
del row mygui myview =
|
||||
case row of
|
||||
r@(_ :/ Dir { dir = FileInfo { isSymbolicLink = True } }) ->
|
||||
delSym r
|
||||
r@(_ :/ RegFile { regFile = FileInfo { isSymbolicLink = True } }) ->
|
||||
delSym r
|
||||
r@(_ :/ Dir _ _) -> do
|
||||
let fp = fullPath r
|
||||
subADT <- readDirectory fp
|
||||
@@ -134,6 +138,13 @@ del row mygui myview =
|
||||
withConfirmationDialog cmsg
|
||||
$ withErrorDialog (deleteFile fp
|
||||
>> refreshTreeView mygui myview Nothing)
|
||||
where
|
||||
delSym r = do
|
||||
let fp = fullPath r
|
||||
cmsg = "Really delete symlink \"" ++ fp ++ "\"?"
|
||||
withConfirmationDialog cmsg
|
||||
$ withErrorDialog (deleteSymlink fp
|
||||
>> refreshTreeView mygui myview Nothing)
|
||||
|
||||
|
||||
-- |Supposed to be used with 'withRow'. Initializes a file copy operation.
|
||||
|
||||
Reference in New Issue
Block a user