Can't get size value back when using $ftp->size 
Author Message
 Can't get size value back when using $ftp->size

Hi,

We have a perl script that transports large data files between Windows
and Linux machines. For some reason, we can't seem to read the file
size on files that reside on the Windows FTP Server (IIS4.0/NTSP6a).
It just returns "" for the size each time. Any thoughts on what might
be causing this?

$ftp = Net::FTP->new($get_machine, Debug => 0);
$status = $ftp->login($username,$password);
print "Getting File\n";
$status = $ftp->get($file);
print "Status: $status\n";

Any advice would be greatly appreciated.

Thanks



Mon, 17 Nov 2003 05:21:08 GMT  
 Can't get size value back when using $ftp->size
[posted to comp.lang.perl.misc]


Quote:
>We have a perl script that transports large data files between Windows
>and Linux machines. For some reason, we can't seem to read the file
>size on files that reside on the Windows FTP Server (IIS4.0/NTSP6a).
>It just returns "" for the size each time. Any thoughts on what might
>be causing this?

SIZE has to be implemented on the server for the client to take advantage
of it. IIS 4.0[1] supports SIZE, but earlier versions of IIS don't. Are you
absolutely sure you're using IIS 4.0's FTP server?

Quote:
>$ftp = Net::FTP->new($get_machine, Debug => 0);
>$status = $ftp->login($username,$password);
>print "Getting File\n";
>$status = $ftp->get($file);
>print "Status: $status\n";

I don't see the size() method used anywhere in this script fragment. Hint:
if you're going to post code, use cut and paste, with actual code that
exhibits the problem as your source.

(snip)

[1]  This is NOT the version supplied in a fresh NT installation, nor are
you upgraded to it automatically via SP6A. You must install the Option Pack
to get IIS 4.0.



Mon, 17 Nov 2003 08:08:11 GMT  
 Can't get size value back when using $ftp->size
Sorry about that, here is the cut and paste:

$status = $ftp->size($file);
print "Status: $status\n";

Yes, we are using IIS 4.0 installed from the option pack.

Any thoughts?

Quote:

> [posted to comp.lang.perl.misc]


> >We have a perl script that transports large data files between Windows
> >and Linux machines. For some reason, we can't seem to read the file
> >size on files that reside on the Windows FTP Server (IIS4.0/NTSP6a).
> >It just returns "" for the size each time. Any thoughts on what might
> >be causing this?

> SIZE has to be implemented on the server for the client to take advantage
> of it. IIS 4.0[1] supports SIZE, but earlier versions of IIS don't. Are you
> absolutely sure you're using IIS 4.0's FTP server?

> >$ftp = Net::FTP->new($get_machine, Debug => 0);
> >$status = $ftp->login($username,$password);
> >print "Getting File\n";
> >$status = $ftp->get($file);
> >print "Status: $status\n";

> I don't see the size() method used anywhere in this script fragment. Hint:
> if you're going to post code, use cut and paste, with actual code that
> exhibits the problem as your source.

> (snip)

> [1]  This is NOT the version supplied in a fresh NT installation, nor are
> you upgraded to it automatically via SP6A. You must install the Option Pack
> to get IIS 4.0.



Tue, 18 Nov 2003 04:16:41 GMT  
 Can't get size value back when using $ftp->size
[posted to comp.lang.perl.misc]


Quote:
>Sorry about that, here is the cut and paste:

>$status = $ftp->size($file);
>print "Status: $status\n";

>Yes, we are using IIS 4.0 installed from the option pack.

>Any thoughts?

For a start, please don't top-post. Quote relevant text, and trim anything
irrelevant.

What happens when you use the command line FTP client at the shell prompt,
with the following command:

ftp> quote SIZE <filename>

You should get a status code (213) and the file size back, in bytes. If you
don't, the problem's with your server and is therefore more appropriately
addressed in a Windows NT group.

If you *do* get a file size back, you may have a buggy version of Net::FTP
and should check for updates. I've used size() on both Win98SE and AIX
communicating with an IIS4.0 server and have had no problems. I'm using
version 2.40 of Net::FTP, with 2.12 of Net::CMD, 1.25 of IO::Socket:INET,
1.26 of IO::Socket, and 1.21 of IO::Handle.

--
 - Jeff Drumm

   Insert dumb Dubya quote here . . . there are plenty to choose from



Tue, 18 Nov 2003 07:29:25 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Differences in the file size reported by Net::FTP->size and ls -l

2. CGI.pm Bug: file upload file size mismatch when file size is close to buffer size

3. Using Image::Size.pm on system where I can't install modules using make

4. Determining File Size Using FTP

5. (Q) getting a file's size in Perl

6. Idea: Term::Size, simple way to get terminal size

7. Getting Traffic Size in Bytes from W3C Extended Format Log

8. Getting partition size from perl script

9. Getting NTFS Directory structure size

10. getting object size?

11. Getting Remote File Size

12. HELP! Getting Remote File Size

 

 
Powered by phpBB® Forum Software