Pipe creation problem: From Java app using rsync + ssh on windows with cygwin

Derek OKeeffe derek0207 at gmail.com
Wed Mar 25 21:46:16 GMT 2009


Hello,

I'm having trouble calling rsync from java on windows vista with cygwin
installed.
Its strange as pasting the exact same command into a command shell works
fine.

My test java call looks like this.
*
String[] envVars = {"PATH=c:/cygwin/bin;%PATH%"};
File workingDir = new File("c:/cygwin/bin/");
Process p = Runtime.getRuntime().exec("c:/cygwin/bin/rsync.exe -verbose -r
-t -v --progress -e ssh /cygdrive/c/Users/dokeeffe/workspace/jrsync/
www.servername.net:/home/dokeeffe/rsync/",envVars,workingDir);
*
Then I start 2 stream reader threads to capture and log the inputStream and
errorStream of the Process p.

Here is the output....
*DEBUG: com.mddc.client.rsync.StreamGobbler - opening connection using: ssh
www.derekokeeffe.net rsync --server -vvtre.iLs . /home/dokeeffe/rsync/
DEBUG: com.mddc.client.rsync.StreamGobbler - rsync: pipe: Operation not
permitted (1)
DEBUG: com.mddc.client.rsync.StreamGobbler - rsync error: error in IPC code
(code 14) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/pipe.c(57)
[sender=3.0.4]
*
The rsync code where the error happens is pipe.c(57) which is this.
    if (fd_pair(to_child_pipe) < 0 || fd_pair(from_child_pipe) < 0) {
        rsyserr(FERROR, errno, "pipe");
        exit_cleanup(RERR_IPC);
    }

So for some reason fd_pair(to_child_pipe) is < 0 or fd_pair(from_child_pipe)
< 0.

If anyone has any suggestions it would be great as I'm stuck now.
Thanks,
Derek
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list