[
https://issues.apache.org/jira/browse/COMPRESS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834203#action_12834203
]
Bill Maier commented on COMPRESS-85:
------------------------------------
I downloaded the archive you attached, and copied it to my AIX machine. I get
the same error when the system command cpio tries to read the file:
[npd1:/home/bmaier/test/java/creator] cpio -ivct <archive.cpio
0 root 593 Dec 31 18:00:00 1969 ApplicationException.class
0 root 857 Dec 31 18:00:00 1969 BData.class
0 root 342 Dec 31 18:00:00 1969 BufException.class
Can't read input
[npd1:/home/bmaier/test/java/creator]
Compared Stefan's archive with mine and they are byte-for-byte identical. I'm
running SUSE on the Linux machine:
bma...@ftw-srv-arv2-02:~> cat /etc/*-release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32"
SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
PATCHLEVEL = 2
> cpio archive final entry corrupt
> --------------------------------
>
> Key: COMPRESS-85
> URL: https://issues.apache.org/jira/browse/COMPRESS-85
> 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, Creator.java
>
>
> 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.