From 9e33526700e6ff5dfe9d9b6c8afe14d8b0fce40e Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 26 Aug 2000 07:26:43 +0000 Subject: [PATCH] ftp cannot put full pathnames, cd to dir instead --- digitiz-xfer | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/digitiz-xfer b/digitiz-xfer index e5b79d3..3fb0caf 100755 --- a/digitiz-xfer +++ b/digitiz-xfer @@ -223,12 +223,17 @@ sub docopy { #copies a file to the remote host _logmsg("copying $source_directory/$file to ". "$destination_host:$dest_file with $protocol"); + #so close + if ( $protocol eq 'ftp' ) { #so close + $xfer->cwd(dirname($dest_file)); + $dest_file = basename($dest_file); + } $xfer->put("$source_directory/$file", $dest_file); my $localsize = -s "$source_directory/$file"; my $remotesize = $xfer->size($dest_file); - if ( $localsize == $remotesize ) { + if ( $localsize && ( $localsize == $remotesize ) ) { logsuccess($file); archive($file); } else { -- 2.11.0