#1652: System.Directory.copyFile breakage
-----------------------------+----------------------------------------------
Reporter: sorear | Owner:
Type: bug | Status: new
Priority: normal | Milestone: Not GHC
Component: libraries/base | Version: 6.7
Severity: normal | Keywords:
Difficulty: Unknown | Os: Linux
Testcase: | Architecture: x86
-----------------------------+----------------------------------------------
Setup: /tmp, with one (executable) file 'x'.
{{{
[EMAIL PROTECTED]:/tmp$ rm *
[EMAIL PROTECTED]:/tmp$ > x
[EMAIL PROTECTED]:/tmp$ chmod +x x
}}}
copyFile with relative paths does not work:
{{{
[EMAIL PROTECTED]:/tmp$ ghc -e 'System.Directory.copyFile "x" "y"'
*** Exception: : copyFile: permission denied (Permission denied)
}}}
strace reveals an attempt to access /, possibly from a filepath mixup:
{{{
[EMAIL PROTECTED]:/tmp$ strace ghc -e 'System.Directory.copyFile "x" "y"'
2>&1 | grep EACCES
open("/.copyFile.3550tmp",
O_RDWR|O_CREAT|O_EXCL|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0666) = -1 EACCES
(Permission denied)
}}}
if absolute paths are used, the operation succeeds:
{{{
[EMAIL PROTECTED]:/tmp$ ghc -e 'System.Directory.copyFile "/tmp/x" "/tmp/y"'
}}}
... but does not copy permissions.
{{{
[EMAIL PROTECTED]:/tmp$ ls -l
total 0
-rwxr-xr-x 1 stefan stefan 0 2007-08-30 09:37 x
-rw-r--r-- 1 stefan stefan 0 2007-08-30 09:38 y
}}}
{{{
[EMAIL PROTECTED]:/tmp$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 6.7.20070829
}}}
(NB: Cabal 'install' trips over this)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1652>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs