commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Maier (JIRA)" <>
Subject [jira] Commented: (COMPRESS-85) cpio archive final entry corrupt
Date Tue, 16 Feb 2010 15:00:28 GMT


Bill Maier commented on COMPRESS-85:

The cpio version on our SUSE is GNU cpio 2.6, quite a bit earlier than Stefan's version. Cpio
on AIX doesn't seem to have an equivalent way of getting the version number.

I have tried other formats (although for our specific application we need the old ASCII format).
It has the same trouble with all the formats I've tried, FORMAT_NEW and FORMAT_OLD_BINARY.
Sometimes I get an "Out of phase" error, but I think this is when my flags don't match the
archive format:

[npd1:/home/bmaier/test/java/creator] cpio -ivct <archive.cpio

Out of phase!
cpio attempting to continue...
Can't read input

> cpio archive final entry corrupt
> --------------------------------
>                 Key: COMPRESS-85
>                 URL:
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: Java 1.4.2 run on AIX and Linux
>            Reporter: Bill Maier
>         Attachments: archive.cpio, archive.cpio, cpio.tar,
> The code below is called with an array of 4 file names. The cpio archive archive.cpio
is created with no error messages, but when I then run the Unix command "cpio -ivct <archive.cpio"
it reports the error "Can't read input" on the last file in the archive. If I run "cpio -ivcBmu
<archive.cpio" the last file is incomplete, but the other files are extracted correctly.
Same result in AIX and Linux.
> {{
>   private void createArchive(String[] outFiles)
>   throws FileNotFoundException, IOException, ArchiveException {
>     short format = CpioArchiveOutputStream.FORMAT_OLD_ASCII;
>     final OutputStream out = new FileOutputStream("archive.cpio");
>     ArchiveOutputStream os = new CpioArchiveOutputStream(out, format);
>     for (int j = 0; j < outFiles.length; j++) {
>       System.out.println("Entry = " + outFiles[j]);
>       File f = new File(outFiles[j]);
>       CpioArchiveEntry entry = new CpioArchiveEntry(format);
>       entry.setName(outFiles[j]);
>       entry.setSize(f.length());
>       os.putArchiveEntry(entry);
>       IOUtils.copy(new FileInputStream(outFiles[j]), os);
>       os.closeArchiveEntry();
>     }
>     os.finish();
>     os.close();
>   }
> }}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message