Hi,
it is not a direct answer to your question and I don't know whether your code is just an excerpt from a bigger context. But if you just want to call rsync with grabbing the output synchronosly you could use the following:
my $rsync_base_cmd = "rsync -avm -L --exclude='S/' --include='*/' --in +clude='*.cpp' " . "--include='*.hpp' --exclude='*'"; my $command = "$rsync_base_cmd ${login}:${remoteDirectory} $localDirec +tory"; open my $fh, '-|', $command or confess("_copy_component Cannot perform rsync : $!"); my $output; while(<$fh>) { $output .= $_; } close $fh or confess("rsync problem: $!");
Best regards
McA
P.S.: untested
In reply to Re: Premature close of the pipe
by McA
in thread Premature close of the pipe
by Superfox il Volpone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |