Superfox il Volpone has asked for the wisdom of the Perl Monks concerning the following question:
Unfortunately the pipe terminates before the command is able to copy all the involved files. But if I print the output into the stdout, then the pipe will correctly finish and all the files will be copied.state $rsync_base_cmd = "rsync -avm -L --exclude='S/' --include='*/' + --include='*.cpp' " . "--include='*.hpp' --exclude='*'"; # perform the copy my $command = "$rsync_base_cmd ${login}:${remoteDirectory} $localDir +ectory"; #print("\n$command\n"); # for debugging #`$command`; my $output = ""; my $pid = open3(undef, my $pipe, undef, $command) or confess("[_copy_component] Cannot perform rsync : $!"); while(<$pipe>){ $output .= $_; } # wait it completes to process eval { close ($pipe); }; waitpid($pid, 0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Premature close of the pipe
by zentara (Cardinal) on Apr 09, 2014 at 15:21 UTC | |
|
Re: Premature close of the pipe
by McA (Priest) on Apr 09, 2014 at 13:43 UTC | |
by Superfox il Volpone (Sexton) on Apr 09, 2014 at 14:59 UTC | |
|
Re: Premature close of the pipe
by Anonymous Monk on Apr 09, 2014 at 17:37 UTC | |
by Superfox il Volpone (Sexton) on Apr 10, 2014 at 14:35 UTC |