|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
my program manage to log in using Net::FTP but i can't see to ftp the file to my directory on my server... i did try all routes to achieve my objective.... but still they give me an error message the foreach function below will get the individual name of the file after NET::FTP
Code:
foreach(@dircontents)
{
my $key=$_;
my $target_dir="/home/speg/diyar/TEST/RESULT";
my $wildcard=".txt";
$pathname=$ftp->pwd;
$totalpathname="$pathname\/$key";
if($key=~"$wildcard"){
@mod_time=$ftp->mdtm($key);
print "Modification Time is @modtime";
print time2str("%C", @mod_time);
print "Pathname of the file: $totalpathname";
#the above code print out : /home/transfer/diyar/TEST/FT1.txt
$ftp->put("$totalpathname",["$target_dir"]);
#the above code in pseuodocode is to transfer file /home/transfer/diyar/TEST/FT1.txt to /home/speg/Cyril/
}
ftp->quit
}
i CANNOT get to transfer the file from that directory to my own directory... and i don't know how to make a condition whereby if the target_directory is not valid in my server then create that target directory.... i know using the mkdir ($target_dir) but i dont know what to put for the if else condition... Help needed. Thanks
__________________
U go PERL.. perlomatic |
|
#2
|
||||
|
||||
|
Could try
unless(-e "$target_dir") { mkdir ($target_dir); }
__________________
webM for $i(0..20){for($j=0;$j<=$i;$j+=2){print pack(qq{H2}, substr(qq{5f5745424d415354415f},$j,2));}print qq{\n};}; |
|
#3
|
|||
|
|||
|
so what does that litle signature code of urs do webM?
|
|
#4
|
||||
|
||||
|
LOL Kaicy.. If I tell ya, then I'll have to kill ya.
|
|
#5
|
|||
|
|||
|
thanks a million webmasta... it works... should have known .... my brain full of C and C++... use alot of if else thingy... now i know how to use unless..... WeeeEEeee... thanks
|
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Can't seem to ftp to the right directory. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|