HPath.IO: add createSymlink
This commit is contained in:
parent
bebc96fa6d
commit
51da8bf5c2
@ -56,6 +56,7 @@ module HPath.IO
|
|||||||
-- * File creation
|
-- * File creation
|
||||||
, createRegularFile
|
, createRegularFile
|
||||||
, createDir
|
, createDir
|
||||||
|
, createSymlink
|
||||||
-- * File renaming/moving
|
-- * File renaming/moving
|
||||||
, renameFile
|
, renameFile
|
||||||
, moveFile
|
, moveFile
|
||||||
@ -315,6 +316,7 @@ copyDirRecursiveOverwrite fromp destdirp
|
|||||||
RegularFile -> copyFileOverwrite f newdest
|
RegularFile -> copyFileOverwrite f newdest
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
|
|
||||||
-- |Recreate a symlink.
|
-- |Recreate a symlink.
|
||||||
--
|
--
|
||||||
-- Throws:
|
-- Throws:
|
||||||
@ -626,6 +628,20 @@ createDir :: Path Abs -> IO ()
|
|||||||
createDir dest = createDirectory (fromAbs dest) newDirPerms
|
createDir dest = createDirectory (fromAbs dest) newDirPerms
|
||||||
|
|
||||||
|
|
||||||
|
-- |Create a symlink.
|
||||||
|
--
|
||||||
|
-- Throws:
|
||||||
|
--
|
||||||
|
-- - `PermissionDenied` if output directory cannot be written to
|
||||||
|
-- - `AlreadyExists` if destination file already exists
|
||||||
|
--
|
||||||
|
-- Note: calls `symlink`
|
||||||
|
createSymlink :: Path Abs -- ^ destination file
|
||||||
|
-> ByteString -- ^ path the symlink points to
|
||||||
|
-> IO ()
|
||||||
|
createSymlink dest sympoint
|
||||||
|
= createSymbolicLink sympoint (fromAbs dest)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user