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

View File

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