Skip to content

Commit 652608e

Browse files
committed
Disambiguate createLink/createSymbolicLink errors
Per the comments on PR #65, it should be unambiguous.
1 parent 484566b commit 652608e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

System/Posix/Files.hsc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ createLink :: FilePath -> FilePath -> IO ()
228228
createLink name1 name2 =
229229
withFilePath name1 $ \s1 ->
230230
withFilePath name2 $ \s2 ->
231-
throwErrnoIfMinus1_ ("createLink "++name1++" to "++name2) (c_link s1 s2)
231+
throwErrnoIfMinus1_ ("createLink (target: "++name1++") (linkpath: "++name2++")") (c_link s1 s2)
232232

233233
-- | @removeLink path@ removes the link named @path@.
234234
--
@@ -241,18 +241,18 @@ removeLink name =
241241
-- -----------------------------------------------------------------------------
242242
-- Symbolic Links
243243

244-
-- | @createSymbolicLink file1 file2@ creates a symbolic link named @file2@
245-
-- which points to the file @file1@.
244+
-- | @createSymbolicLink name1 name2@ creates a symbolic link named @name2@
245+
-- which points to the file @name1@.
246246
--
247247
-- Symbolic links are interpreted at run-time as if the contents of the link
248248
-- had been substituted into the path being followed to find a file or directory.
249249
--
250250
-- Note: calls @symlink@.
251251
createSymbolicLink :: FilePath -> FilePath -> IO ()
252-
createSymbolicLink file1 file2 =
253-
withFilePath file1 $ \s1 ->
254-
withFilePath file2 $ \s2 ->
255-
throwErrnoIfMinus1_ ("createSymbolicLink "++file1++" to "++file2) (c_symlink s1 s2)
252+
createSymbolicLink name1 name2 =
253+
withFilePath name1 $ \s1 ->
254+
withFilePath name2 $ \s2 ->
255+
throwErrnoIfMinus1_ ("createSymbolicLink (target: "++name1++") (linkpath: "++name2++")") (c_symlink s1 s2)
256256

257257
foreign import ccall unsafe "symlink"
258258
c_symlink :: CString -> CString -> IO CInt

0 commit comments

Comments
 (0)