HPath.IO: add createSymlink

This commit is contained in:
2016-05-29 17:28:12 +02:00
parent bebc96fa6d
commit 51da8bf5c2

View File

@@ -56,6 +56,7 @@ module HPath.IO
-- * File creation
, createRegularFile
, createDir
, createSymlink
-- * File renaming/moving
, renameFile
, moveFile
@@ -315,6 +316,7 @@ copyDirRecursiveOverwrite fromp destdirp
RegularFile -> copyFileOverwrite f newdest
_ -> return ()
-- |Recreate a symlink.
--
-- Throws:
@@ -626,6 +628,20 @@ createDir :: Path Abs -> IO ()
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)
----------------------------