FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 12th, 2003, 01:40 AM
Diyar Diyar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Singapore
Posts: 54 Diyar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 54 sec
Reputation Power: 5
To check for condition during NET::FTP

Is it possible to check the file using some conditions during Net::FTP? or is there any other wae...?

erm... i did read the Net:: FTP documentation and mostly i understand... but it doesnt help what i wish to do...

my OBJECTIVES is making a program that

1. my server(A) ftp and connect to a given machine(B) by their IP address

2. check the time , date and size of the file in (B)

3. check if files in (B) already in server (A) and is the same (size) in server(A)

4. The machine (B) keep processing new files... so must check check whether the file is still in use

5. Copy the files from machine(B) to my server(A) but don't copy the files that is stiil in process and don't copy the files that is already in server(A)

specification of machine B:
This machine B will generate files constantly

specification of my program in Server A:
It will get all the files except for the files which is still generating, from Machine B.

ermm... get the logic? well it needs to run some condition before it copy the files to my own server. and im working on Server(A)

for the subroutine Net::FTP
i manage to list the all files from that machine(B) on my server(A)

Code:
sub netftp{
use Net::FTP;
my hostname="$ip"; #where i assign 112.11.125.45 to the $ip variable on my main function
my home="/home/transfer/diyar/FT1";

$ftp = Net::FTP->new("$ip")|| die "Cannot connect to $ip";
$ftp->login("transfer",'transfer') ||die "Cannot Login", 
$ftp->message;

$ftp->cwd($home);

@dircontents=$ftp->ls($home);

$ftp->quit;
foreach(@dircontents)
{
print"$_\n";
}
}


That, i know how to ftp and I did search in the forum on how to get and put the file name into my directory...

which is
Code:
$ftp->put($source fiel,$targetfile);


But my 1st objective can be met but my 2nd to 5th objective, i do not know how to go around solving the problem...

please help

Tankz
19yr old Student
__________________
U go PERL.. perlomatic

Reply With Quote
  #2  
Old September 12th, 2003, 01:45 AM
Diyar Diyar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Singapore
Posts: 54 Diyar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 54 sec
Reputation Power: 5
typo error in the ferst message:

Code:
$ftp->put($sourcefile,$targetfile);


Rephrase:

Im able to do the 1st objective, but do not know how to achieve my 2nd to 5th objectives

tankz

Reply With Quote
  #3  
Old September 12th, 2003, 05:38 AM
zby zby is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2003
Location: Prague, Czech Republic
Posts: 825 zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level)zby User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 16 h 4 m 55 sec
Reputation Power: 65
1. my hostmane better used as my $hostname as well as my home as my $home
2. you may also use dir to retrieve a full files list as if you would use ls -l.
3. received info may by saved into an array and parsed using split to get a prticular info you want.
4. based on this 'dump' you may decide which one to download.
5. don't know how to keep monitoring the transfer of files at the moment, but using socket module may give you a clue a way to go.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > To check for condition during NET::FTP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway