Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Net::FTP on OSX10.3 corrupting files

by manchot (Initiate)
on Nov 06, 2003 at 23:22 UTC ( [id://305188]=perlquestion: print w/replies, xml ) Need Help??

manchot has asked for the wisdom of the Perl Monks concerning the following question:

My upload script using 5.8.0 and Net::FTP has been uploading my mp4s for a couple months, but since upgrading to OSX Panther (and 5.8.1), it's corrupting my movies! They upload, but Quicktime complains about "no moov atom", says they're corrupt, and won't play them.

Mac's Fetch uploads them just fine.

So I added
$ftp->type('binary');
just to be safe, but it didn't help.

(should that be $ftp ->binary() I thought I had understood they were equivalent.. but I also thought it shouldn't be necessary at all.. )

thanks,
- John

Replies are listed 'Best First'.
Re: Net::FTP on OSX10.3 corrupting files
by mandog (Curate) on Nov 06, 2003 at 23:36 UTC

    Have you compared a file uploaded with fetch to a file uploaded with Net::FTP ?

    ls -l diff filea fileb strings filea > a.txt strings fileb > b.txt diff a.txt b.txt | more

    It might be easier to compare non binary files as a control, but you can force diff to do binary files

      Yes, the files are slightly different sizes, and diff-a spits out a ton of junk (remember, they're mpeg4s, and 40+MB each.. )

      Comparing the strings output, they starts out similar, and with some binary looking characters in them, too..

      43810573 Nov 06 16:25 x.mp4 (Net::FTP)
      43811351 Nov 06 13:45 y.mp4 (Fetch)

      %> head *.txt
      ==> x.txt<==
      ftypmp42 mp42isom kmoov lmvhd çġtrak \tkhd $edts elst çmmdia mdhd
      ==> y.txt <==
      ftypmp42 mp42isom kmoov lmvhd çġtrak \tkhd $edts elst çmmdia mdhd

      had to stop the strings, cuz each file was generating around 24 MEGs of "strings"!!

      Clearly, fetch and Net::FTP are not doing the same thing!

      Just to add that there is a gnu program called bdiff that specializes in diffing binary files. And also bvi to edit binary files.

Re: Net::FTP on OSX10.3 corrupting files
by vek (Prior) on Nov 07, 2003 at 04:34 UTC

    Set $ftp->binary;. Are the files ok now?

    -- vek --
Re: Net::FTP on OSX10.3 corrupting files
by castaway (Parson) on Nov 07, 2003 at 11:04 UTC
    Did you try comparing with a command-line or browser FTP, assuming you have one?

    C.

      No, I haven't yet tried with a vanilla commandline ftp and won't have access to the box till Monday now.. sigh..

      re $ftp->binary -- can somebody tell me why this would have become necessary with 5.8.1 and/or panther?
      j.

        Unless I'm mistaken, isn't ASCII mode the default hence the reason why you must specifically set binary mode?

        -- vek --

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://305188]
Approved by HyperZonk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-25 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found