For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > November 2007 > perl ftp and hidden partitions









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 perl ftp and hidden partitions
schmmichael@gmail.com

2007-11-26, 8:07 am

Hi all

I have an automation problem with perl and a ftp server.
The server is running on a B&R-SPS. This contains a flash memory (2GB)
for data logging.
The files will be on a hidden partition called "F".

I tried to log in on different ways:
e.g.:


my $ftp=Net::FTP->new($host,Port => 21, Debug => 1, Passive => 1) or
die "Couldn't connect: $@\n";
print "Connected\n";

$ftp->login('br','br',"/F:/") or die $ftp->message;
my $type = $ftp->binary;
my @files = $ftp->ls();
foreach (@files)
{
print "$_\n";
}
$ftp->quit;
print "closed ftp connection\n";

The problem is that I can login, but get only the file list of
partition "C", which isn't a hidden one. So I don't know
how I can login into the hidden partition with perl

Best thanks for any help
Brian McCauley

2007-11-26, 7:13 pm

On Nov 26, 11:03 am, schmmich...@gmail.com wrote:
> Hi all
>
> I have an automation problem with perl and a ftp server.
> The server is running on a B&R-SPS. This contains a flash memory (2GB)
> for data logging.
> The files will be on a hidden partition called "F".
>
> I tried to log in on different ways:
> e.g.:
>
> my $ftp=Net::FTP->new($host,Port => 21, Debug => 1, Passive => 1) or
> die "Couldn't connect: $@\n";
> print "Connected\n";
>
> $ftp->login('br','br',"/F:/") or die $ftp->message;
> my $type = $ftp->binary;
> my @files = $ftp->ls();
> foreach (@files)
> {
> print "$_\n";}
>
> $ftp->quit;
> print "closed ftp connection\n";
>
> The problem is that I can login, but get only the file list of
> partition "C", which isn't a hidden one. So I don't know
> how I can login into the hidden partition with perl


Just what does "hidden" mean in this context? Does it perhaps mean
"unlistable"? If so what did you expect?

Have you tried just getting the files (by full name)?
Sherman Pendley

2007-11-26, 7:13 pm

schmmichael@gmail.com writes:

> Hi all
>
> I have an automation problem with perl and a ftp server.
> The server is running on a B&R-SPS. This contains a flash memory (2GB)
> for data logging.
> The files will be on a hidden partition called "F".
>
> I tried to log in on different ways:
> e.g.:
>
>
> my $ftp=Net::FTP->new($host,Port => 21, Debug => 1, Passive => 1) or
> die "Couldn't connect: $@\n";
> print "Connected\n";
>
> $ftp->login('br','br',"/F:/") or die $ftp->message;


That third argument looks odd - the Net::FTP docs call it "ACCOUNT," which
implies that it will (if provided) cause the client to issue the FTP command
of the same name, which has nothing to do with establishing a working dir
for the session.

You can see the description of the ACCOUNT command here:

<http://www.faqs.org/rfcs/rfc959.html>

Have you tried logging in without the third param, and then using the cwd()
method to change to the drive & directory you want? Something like this:

$ftp->login('br','br') or die $ftp->message;
$ftp->cwd('/F:/') or die $ftp->message;

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
schmmichael@gmail.com

2007-11-29, 7:07 pm

On 26 Nov., 18:06, Sherman Pendley <spamt...@dot-app.org> wrote:
> schmmich...@gmail.com writes:
>
>
>
>
>
> That third argument looks odd - the Net::FTP docs call it "ACCOUNT," which
> implies that it will (if provided) cause the client to issue the FTP command
> of the same name, which has nothing to do with establishing a working dir
> for the session.
>
> You can see the description of the ACCOUNT command here:
>
> <http://www.faqs.org/rfcs/rfc959.html>
>
> Have you tried logging in without the third param, and then using the cwd()
> method to change to the drive & directory you want? Something like this:
>
> $ftp->login('br','br') or die $ftp->message;
> $ftp->cwd('/F:/') or die $ftp->message;
>
> sherm--
>
> --
> WV News, Blogging, and Discussion:http://wv-www.com
> Cocoa programming in Perl:http://camelbones.sourceforge.net- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -


Thank for all this tips.
I figured out that
$ftp->login('br','br') or die $ftp->message;
$ftp->cwd('/F:/') or die $ftp->message;

works, but not each time. So I think the error is not in my perl code!

I will check the ftp-server and some application code on the sps

thanks again to all the people answerd my question

Michael
Sponsored Links







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

Copyright 2008 codecomments.com