perl ftp and hidden partitions
perl ftp and hidden partitions
am 26.11.2007 12:03:38 von schmmichael
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
Re: perl ftp and hidden partitions
am 26.11.2007 16:13:16 von nobull67
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)?
Re: perl ftp and hidden partitions
am 26.11.2007 18:06:25 von Sherm Pendley
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:
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
Re: perl ftp and hidden partitions
am 29.11.2007 17:10:26 von schmmichael
On 26 Nov., 18:06, Sherman Pendley wrote:
> schmmich...@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:
>
>
>
> 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