Click here to get back home

Archive::Zip - zip file has "invalid" format

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Archive::Zip - zip file has "invalid" format MoshiachNow 10-05-2006
Posted by MoshiachNow on October 5, 2006, 9:41 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by Mumia W. (reading news) on October 5, 2006, 10:25 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by usenet on October 5, 2006, 7:02 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
Photo does not recognize format of Archive::Zip contents June 8, 2005, 6:13 am
trouble with Archive::Tar : Can not read compressed format in tar-mode July 26, 2005, 10:54 am
Invalid top directory at d:\perl\lib\file\find.pm line 562 September 27, 2007, 5:02 am
Reading the first .jpg file from a .rar archive? June 21, 2006, 7:59 am
Archive::Zip - end up with empty file ... October 4, 2006, 11:37 am
How to compress a big file into many zip files with Archive::Zip? November 19, 2006, 3:15 am
zipping large file using Archive::Zip November 9, 2007, 2:55 pm
File Size Limit in Archive::Perl November 10, 2007, 6:34 am
Amount of entries in zip file [Archive::Zip (Compress::Zlib)] January 27, 2006, 10:59 am
Upload file format checking March 1, 2006, 8:25 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap