Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.perl.misc > #1711
| From | Uno <Uno@example.invalid> |
|---|---|
| Newsgroups | comp.lang.perl.misc, comp.unix.shell, misc.news.internet.discuss, comp.lang.c |
| Subject | Re: variable-length strings |
| Date | 2011-06-02 10:54 -0600 |
| Message-ID | <94ptioF1gaU1@mid.individual.net> (permalink) |
| References | <94mfhcFngqU1@mid.individual.net> <e3cdb103-3274-402d-b599-5815d93e0fb9@r27g2000prr.googlegroups.com> |
Cross-posted to 4 groups.
On 06/01/2011 08:13 AM, ccc31807 wrote:
> On Jun 1, 5:36 am, Uno<U...@example.invalid> wrote:
>> q1) Why did I die?
>
> The simplest place to start is with your command line ftp program. If
> you can connect and transfer files with your command line ftp, then IN
> THEORY you should be able to put the same series of commands in a
> batch file (i.e., a Perl script) and run them. If you can do that,
> then you have all the functionality you neet./
I needed a fresh day and fresh eyes, and t set Debug=> 2 to see that the
wsb "web site builder" number was wrong. That's a separate directory
that my host uses for when they build the website. I want to adios this
thing, so I called them, and they have you change an administrative
setting so that a browser will be directed to the index.html in the root
menu as opposed to in the wsb folder.
So now this /wsb.../ thing is a relic for me to play with and destroy.
Why didn't this work:
[sorry can only paste as quotation:]
> $ perl marni5.pl
> Net::FTP>>> Net::FTP(2.77)
> Net::FTP>>> Exporter(5.63)
> Net::FTP>>> Net::Cmd(2.29)
> Net::FTP>>> IO::Socket::INET(1.31)
> Net::FTP>>> IO::Socket(1.31)
> Net::FTP>>> IO::Handle(1.28)
> Net::FTP=GLOB(0xa07a7d8)<<< 220 FTP Server ready.
> Net::FTP=GLOB(0xa07a7d8)>>> USER u61210220
> Net::FTP=GLOB(0xa07a7d8)<<< 331 Password required for u61210220
> Net::FTP=GLOB(0xa07a7d8)>>> PASS ....
> Net::FTP=GLOB(0xa07a7d8)<<< 230 User u61210220 logged in
> Net::FTP=GLOB(0xa07a7d8)>>> RMD /wsb6121022001/
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/: Directory not empty
> Net::FTP=GLOB(0xa07a7d8)>>> PORT 192,168,0,64,142,193
> Net::FTP=GLOB(0xa07a7d8)<<< 200 PORT command successful
> Net::FTP=GLOB(0xa07a7d8)>>> NLST /wsb6121022001/
> Net::FTP=GLOB(0xa07a7d8)<<< 150 Opening ASCII mode data connection for file list
> Net::FTP=GLOB(0xa07a7d8)<<< 226 Transfer complete
> Net::FTP=GLOB(0xa07a7d8)>>> DELE /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/.: Is a directory
> Net::FTP=GLOB(0xa07a7d8)>>> RMD /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/.: Directory not empty
> Net::FTP=GLOB(0xa07a7d8)>>> PORT 192,168,0,64,186,213
> Net::FTP=GLOB(0xa07a7d8)<<< 200 PORT command successful
> Net::FTP=GLOB(0xa07a7d8)>>> NLST /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 150 Opening ASCII mode data connection for file list
> Net::FTP=GLOB(0xa07a7d8)<<< 226 Transfer complete
...
it just keeps on telling me Directory not empty
> ^C
> $ cat marni5.pl
> #!/usr/bin/perl -w
> use Net::FTP;
> my $domain = 'www.merrillpjensen.com';
> my $username = 'u61210220';
> my $password = '';
>
> $ftp = Net::FTP->new($domain, Debug => 2) or die "Can't connect: $@\n";
> $ftp->login($username, $password) or die "Couldn't login\n";
>
> my $recurse = 1;
> $ftp->rmdir('/wsb6121022001/', $recurse);
> #$ftp->cwd('/wsb6121022001/') or die "death $@\n";
>
> my @file = $ftp->ls();
>
> foreach $file (@file){
> print "$file\n";
> }
> $
Cpan says that RECURSE has to be true, and I thought a good guess for
"true" in a syntax that is a child of C would be one.
>
>> q2) [I imagine that I have a distinct question for each listed ng] In
>> There's no way I can look at these files with a hex editor and my eyes.
>> Doesn't unix have a built-in way to compare them?
>
> On Unix/Linux, use diff. If you are comfortable with vi/vim, it also
> has a diff capability.
Thx, ccc, I'll do that. Here's what's vexing me right now.
http://www.merrillpjensen.com/images/jac1.bmp
The only difference between these files, is that the smaller one went on
a round on the internet. It was sent up like this:
> #!/usr/bin/perl -w
> use strict;
> use Net::FTP;
> my $domain = 'www.merrillpjensen.com';
> my $username = 'u61210220';
> my $password = '';
> my $file = 'jac1.bmp';
> my $dir = '/images/';
>
> my $ftp = Net::FTP->new($domain, Debug =>2) or die "Can't connect: $@\n";
> $ftp->login($username, $password) or die "Couldn't login\n";
> $ftp->mkdir($dir) or die "death: $@\n";
> $ftp->cwd($dir) or die "death: $@\n";
> $ftp->put($file) or die "put failed ", $ftp->message;
And downloaded using google chrome. Is this typical, because if my
experience is, then I don't really see how any large file gets
transferred faithfully.
Gotta go pull down some legal tender. Adios.
--
Uno
Back to comp.lang.perl.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
variable-length strings Uno <Uno@example.invalid> - 2011-06-01 03:36 -0600
Re: variable-length strings ccc31807 <cartercc@gmail.com> - 2011-06-01 07:13 -0700
Re: variable-length strings Uno <Uno@example.invalid> - 2011-06-02 10:54 -0600
Re: variable-length strings "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam> - 2011-06-01 17:01 +0300
Re: variable-length strings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2011-06-02 15:33 +0200
Re: variable-length strings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2011-06-02 15:44 +0200
csiph-web