ftp download completes, but unzip says otherwise

I ran into a bizzarre error on linux:

I download a file using Net::FTP. Once get() method returns, I call the system unzip function:

   system("unzip -j $file");

the majority of the time, it looks as though the downloaded file didn't quite finish:

   error [<filepath>]:  missing 1862 bytes in zipfile

Why would something like this happen? I suppose, I can write code to wait and handle the error, but why isn't the filesystem updated when Net:FTP::get() returns?

Answers


Right. Needed to set binary mode for ftp transfer.

Whatever made it decide to go ascii? I thought binary was automatic nowadays. It's not!


Need Your Help

Instantiating an ifstream object without using a variable

c++ templates iostream

I can't seem to open a file without storing it in a variable. I can do this:

SQL Server 2012 FileTable- is a file stored IN the database?

sql-server-2012 filetable

If I create a FileTable in SQL server 2012, and then was to drop a 4G file onto the NT filesystem (that was in the filestream), would that entire 4G file be read into the table's filestream column?...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.