commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Maier (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COMPRESS-85) cpio archive final entry corrupt
Date Wed, 17 Feb 2010 16:39:28 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834829#action_12834829
] 

Bill Maier commented on COMPRESS-85:
------------------------------------

That archive works on AIX using either

  cpio -ivct <archive.cpio

for listing or

  cpio -ivcmu <archive.cpio

for extraction. Apparently the block size is a factor here, so you've
made some progress. Interestingly it still doesn't work using

  cpio -ivcBmu <archive.cpio

where the B option is supposed to force 512-byte blocks (?!).

Cpio still can't read the archive in SUSE. I tried all of these commands:

  cpio -ivct <archive.cpio
  cpio -ivctB <archive.cpio
  cpio -ivctC512 <archive.cpio
  cpio -ivctC5120 <archive.cpio
  cpio -ivctC 5120 <archive.cpio
  cpio -ivctC 512 <archive.cpio
  cpio -ivct --block-size=512 <archive.cpio
  cpio -ivct --block-size=5120 <archive.cpio

It always reports "cpio: premature end of file".

> 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, archive.cpio, archive.cpio, archive.cpio,
cpio.tar, Creator.java, Creator.java, 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.


Mime
View raw message