FTP Perl Script File Size Mismatch.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP Perl Script File Size Mismatch.
# 1  
Old 06-03-2009
FTP Perl Script File Size Mismatch.

Hello,

I've written a Perl script that copies a set of files from one server to another.

Prior to transferring a file the script gets the file size from the source system and compares this to the file size received in the target system.

Except that the file sizes are slightly different.

Although I don't issue a binary command, I am fairly sure the transfer is made binary because I am testing with a compressed copy of the 'ls' executable, which runs fine on the target system.

A manual transfer using FTP at the command line shows no difference in the file sizes and all my tests are the same. This only happened when run against my live systems and files.

Apart from the difference between binary and ASCII transfer, has anyone any ideas why the file sizes would be slightly different?

Thanks.
# 2  
Old 09-26-2009
Yes, I have noticed the same. Although I dont know the answer either, I take it that some metadata on the file could be kept on one system and not the other.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTP zero size file

Hi AM using unix Aix Ksh I need to clarify regarding sending the zero size file to another server. VAL=ftp.sh -c put souce_file Dest_file $1 $2 $3 $4 $5 $VAL 2 > $ERR When am Sending the Zero Size File getting alerts netout write returned Zero. But i would like to know $VAL... (4 Replies)
Discussion started by: Venkatesh1
4 Replies

2. Shell Programming and Scripting

Output after a perl script gives a file with size zero.

Hi, I have a unix shell script which generates a flat file after connecting to Teradata servers to fetch tables and views and also picks up modified unix scripts from the specified paths. Later on the script calls a perl script to assign a value based on the type of object in the flat file which... (2 Replies)
Discussion started by: yohasini
2 Replies

3. Shell Programming and Scripting

Unable to get the size of remote file using Net::FTP Perl Script

Hi, I am using below piece of code to get the size of the remote file. $ftp->cwd($destination) or $error=$ftp->message; if(!$error) { $ftp->put($file) or $error=$ftp->message; print "FTP size = \n"; ... (3 Replies)
Discussion started by: FarooqOnline
3 Replies

4. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

5. Shell Programming and Scripting

Perl Script to check file date and size

Hi guys, i am new to perl. I started reading the perl documents and try to come up with some logic. I am trying to create a script that would go into a location, search for todays files, then searches for all .txt files from today. If todays not found, its an error If file size is less... (26 Replies)
Discussion started by: DallasT
26 Replies

6. Ubuntu

device size mismatch after mounting

Hi, I have a created a logical partition sda5 in ubuntu server 9.0.4. which is Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00053d78 Device Boot Start End ... (1 Reply)
Discussion started by: rac_oradba
1 Replies

7. Shell Programming and Scripting

Shell script to FTP if file size is 0KB

Hi all, I was a UNIX shell script that will check for the file size of each file and it should be re directed to a text file say filesize.txt And if there are more than 10 0KB files then FTP should not happend and whenever there are less than 10 0KB files it should FTP the files. Kindly help me... (1 Reply)
Discussion started by: Codesearcher
1 Replies

8. Shell Programming and Scripting

Perl FTP - check file size

The FTP perl module does not have any function which checks if the file downloaded is of size 0. Is there any way in perl to check while getting the files through FTP? Sometimes, there might be a problem with FTP and the downloaded file maybe of size 0. Hence, I would like to FTP that file... (1 Reply)
Discussion started by: rahulrathod
1 Replies

9. UNIX for Dummies Questions & Answers

ftp hangs on file size = 0

I have an ftp process which runs every 10 minutes between Unix and an NT box. Normally it works, but when the script tries to get a file from NT that has a length of 0, the ftp process hangs (as if it is still waiting for the end of the file). This is the script... (3 Replies)
Discussion started by: mheinrich
3 Replies

10. UNIX for Advanced & Expert Users

ftp file size

how to compare file size which has been received through ftp get from a remote location with local copy available any clue regards (5 Replies)
Discussion started by: sathiya
5 Replies
Login or Register to Ask a Question