HPath.IO: add createSymlink

This commit is contained in:
Julian Ospald 2016-05-29 17:28:12 +02:00
parent bebc96fa6d
commit 51da8bf5c2
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 16 additions and 0 deletions

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)
----------------------------