ganeshm69 has asked for the wisdom of the Perl Monks concerning the following question:
The above code gives the server response,in the Stdout. i want to redirect this out to a LogFile. since i do this FTP process in a Loop.From the logfile, i can check whether the file has been ftp'ed properly or not in the Log file. A similar code in Shell is like################################## $ftp = Net ::FTP->new("xxx.xxx.xxx",Timeout=>30,Debug=>1) $ftp->login($usr,$paswd) $ftp->cwd($dir) $ftp->get($filename); quit; #################################
here i get the log file from the FTP process into LOGFile. i would like to do the same in Perl. Could any one Help me in this Issue.######################################### ftp -nv ${ipaddress} << !!! > ${LOGFile} user ${USER} ${PASSWD} cd ${FTPHOME} get ${File} quit !!! #############################################
2002-10-26 Edit by Corion : Added Code tags
Try This: ganeshm69 ############################################# open( STDERR , "> FTP_LOG" ); $ftp = Net ::FTP->new("xxx.xxx.xxx",Timeout=>30,Debug=>1) $ftp->login($usr,$paswd) $ftp->cwd($dir) $ftp->get($filename); quit; close(STDERR); ############################################# #The response will be present in the log (FTP.log) file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem while FTP
by Mr. Muskrat (Canon) on Oct 26, 2002 at 13:16 UTC | |
|
Re: Problem while FTP
by vek (Prior) on Oct 26, 2002 at 16:55 UTC | |
by graff (Chancellor) on Oct 27, 2002 at 05:14 UTC | |
|
Re: Problem while FTP
by TStanley (Canon) on Oct 27, 2002 at 02:37 UTC | |
|
Re: Problem while FTP
by converter (Priest) on Oct 27, 2002 at 14:18 UTC |