For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2004 > Copy folder using Net::FTP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Copy folder using Net::FTP
Roime bin Puniran

2004-09-22, 3:57 pm

I am new in PERL programming...I have one question to ask..How can i =
transfer a folder in 2 different machine using Net::FTP...Now, i can =
transfer a sigle file between 2 machine but i am still having problemm =
to transfer a folder using Net::FTP...Did anybony have any =
idea?....Please help me......

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
Chris Devers

2004-09-22, 3:57 pm

On Mon, 20 Sep 2004, Roime bin Puniran wrote:

> I am new in PERL programming...


Okay -- it's "Perl" for the language, "perl" for the program that runs
programs written in the language, and "PERL" for nothing. In spite of
what some of the docs jokingly say, "Perl" doesn't stand for anything,
so it shouldn't be capitalized as if it's an acronym.

> I have one question to ask..How can i transfer a folder in 2 different
> machine using Net::FTP...Now, i can transfer a sigle file between 2
> machine but i am still having problemm to transfer a folder using
> Net::FTP...Did anybony have any idea?....Please help me......


Would making a tarball out of it be an option?

That's the old-fashioned but proven way to send directories full of
files around: make a tarball (`tar -cvf files.tar dir/`), send it to the
remote machine, then unpack it (`tar -zxv files.tar`).

If you're on Windows, a zip archive is roughly equivalent, but I'm not
sure how that could be driven from Perl (I'm sure it could be done, I
just don't know what way makes sense). On the other hand, Archive::Tar
should be able to do it nicely:

<http://search.cpan.org/~kane/Archiv.../Archive/Tar.pm>


--
Chris Devers
Roime bin Puniran

2004-09-22, 3:57 pm

Thanks for ur reply..Actually, i need to transfer a folder that continously updated. It's so difficult to tarball a directory first then send it through Net::FTP while the content of the directory always updated...I mean my problem is, i need to transfer a folder without tarball it first using Net::SFTP..I hope i make it clear...

However, thanks Chris following ur advice


-----Original Message-----
From: Chris Devers [mailto:cdevers@pobox.com]
Sent: Mon 9/20/2004 1:26 PM
To: Roime bin Puniran
Cc: Perl Beginners List
Subject: Re: Copy folder using Net::FTP
On Mon, 20 Sep 2004, Roime bin Puniran wrote:

> I am new in PERL programming...


Okay -- it's "Perl" for the language, "perl" for the program that runs
programs written in the language, and "PERL" for nothing. In spite of
what some of the docs jokingly say, "Perl" doesn't stand for anything,
so it shouldn't be capitalized as if it's an acronym.

> I have one question to ask..How can i transfer a folder in 2 different
> machine using Net::FTP...Now, i can transfer a sigle file between 2
> machine but i am still having problemm to transfer a folder using
> Net::FTP...Did anybony have any idea?....Please help me......


Would making a tarball out of it be an option?

That's the old-fashioned but proven way to send directories full of
files around: make a tarball (`tar -cvf files.tar dir/`), send it to the
remote machine, then unpack it (`tar -zxv files.tar`).

If you're on Windows, a zip archive is roughly equivalent, but I'm not
sure how that could be driven from Perl (I'm sure it could be done, I
just don't know what way makes sense). On the other hand, Archive::Tar
should be able to do it nicely:

<http://search.cpan.org/~kane/Archiv.../Archive/Tar.pm>


--
Chris Devers





This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
$_@_.%_

2004-09-22, 8:58 pm


roime@rndtm.net.my (Roime bin Puniran) wrote in message-id:
< 797EE728F2A2A24AB7A7FA2ADB6CE6B36F3831@p
roliant1>
>
>I am new in PERL programming...I have one question to ask..How can i transfer a folder in 2 different machine using Net::FTP...Now, i can transfer a sigle file between 2 machine but i am still having problemm to transfer a folder using Net::FTP...Did any

bony have any idea?....Please help me......
>
>This e-mail and any attachments may contain confidential and
>privileged information. If you are not the intended recipient,
>please notify the sender immediately by return e-mail, delete this
>e-mail and destroy any copies. Any dissemination or use of this
>information by a person other than the intended recipient is
>unauthorized and may be illegal.


The program should first issue the appropriate MKD commands,
then issue all of the appropriate STOR commands.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com