#3130: copyFile and findExecutable don't work correctly if filename has national
symbols
---------------------+------------------------------------------------------
Reporter:  shelarcy  |          Owner:                     
    Type:  bug       |         Status:  new                
Priority:  normal    |      Component:  libraries/directory
 Version:  6.10.1    |       Severity:  normal             
Keywords:            |       Testcase:                     
      Os:  Windows   |   Architecture:  x86                
---------------------+------------------------------------------------------
 copyFile works doesn't work if first argument's filename has national
 symbols.

 {{{
 import System.Directory

 main = do
     copyFile "test.txt" "テスト.txt" -- works
     print "copyFile works if second argument has national path."

     copyFile "テスト.txt" "test2.txt" -- doesn't work
     print "copyFile doesn't work if second argument has national path."

     copyFile "テスト.txt" "テスト2.txt" -- doesn't work
     print "copyFile doesn't work if first argument has national path."
 }}}

 {{{
 C:\home>runghc.exe Test.hs
 "copyFile works if second argument has national path."
 Test.hs: ニケネ.txt: copyFile: does not exist (No such file or directory)
 }}}

 System.Win32.copyFile doesn't cause this problem.

 {{{
 import System.Win32

 main = do
     copyFile "test.txt" "テスト.txt" False -- works
     print "copyFile works if second argument has national path."

     copyFile "テスト.txt" "test2.txt" False -- doesn't work
     print "copyFile doesn't work if second argument has national path."

     copyFile "テスト.txt" "テスト2.txt" False -- doesn't work
     print "copyFile doesn't work if first argument has national path."
 }}}

 {{{
 C:\home>runghc.exe Test.hs
 "copyFile works if second argument has national path."
 "copyFile doesn't work if second argument has national path."
 "copyFile doesn't work if first argument has national path."
 }}}

 And findExecutable return Nothing if executable file name has  national
 symbols.

 {{{
 import System.Directory -- hiding (getDirectoryContents)

 main = findExecutable "テスト" >>= print
 }}}

 {{{
 C:\home>runghc.exe Test.hs
 Nothing
 }}}

 So, I made patch for these two problems.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3130>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to