jonny created IO-371:
------------------------

             Summary: FileUtils.copyDirectory and copyFile fail on AIX hosts 
over CIFS mounted directory
                 Key: IO-371
                 URL: https://issues.apache.org/jira/browse/IO-371
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.4
         Environment: Java 1.6, AIX, FileUtils, Groovy 2.1.1, cifs
            Reporter: jonny
            Priority: Minor


In a groovy script that imports org.apache.commons.io.FileUtils, I'm trying to 
copy a directory from one location to another. Both locations are accessed 
through a mounted CIFS directory. When I try, I get this exception:
{code}
java.io.IOException: A system call received a parameter that is not valid.
        at sun.nio.ch.FileChannelImpl.map0(Native Method)
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:768)
        at 
sun.nio.ch.FileChannelImpl.transferFromFileChannel(FileChannelImpl.java:552)
        at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:615)
        at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1147)
        at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1428)
        at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1389)
        at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1261)
        at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1230)
        at org.apache.commons.io.FileUtils$copyDirectory.call(Unknown Source)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at plutarch.archiveOldFilesOnSabrina(plutarch.groovy:111)
        at plutarch$archiveOldFilesOnSabrina.callCurrent(Unknown Source)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
        at plutarch.run(plutarch.groovy:47)
        at 
groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:257)
        at groovy.lang.GroovyShell.run(GroovyShell.java:220)
        at groovy.lang.GroovyShell.run(GroovyShell.java:150)
        at groovy.ui.GroovyMain.processOnce(GroovyMain.java:588)
        at groovy.ui.GroovyMain.run(GroovyMain.java:375)
        at groovy.ui.GroovyMain.process(GroovyMain.java:361)
        at groovy.ui.GroovyMain.processArgs(GroovyMain.java:120)
        at groovy.ui.GroovyMain.main(GroovyMain.java:100)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at 
org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
{code}

This executes normally on Windows using the same version of Java (1.6). Another 
user has a similar experience that makes me think this is an issue specific to 
AIX: 
http://stackoverflow.com/questions/15092855/howto-copy-a-folder-and-all-its-content-in-java-recursively-including-symbolic

Given the stack trace, this is probably something that Java 1.7 addressed, but 
it may be worthwhile for the copyDirectory and copyFile methods to provide a 
switch to handle symbolic links.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to