You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Jtar in an application to tar a directory of files in windows. Analysis of the file created indicates that it is using a blocking factor of 3.
The application that extracts (tar -xfv filename) runs on a hpux box and apparently uses the default block size of 20 but is giving me the error "Tar: tape blocksize error". And when I use tar bxfv -b 3 filename, it works.
The problem is I can't change the extract application to use that factor so I need to know how to do it with Jtar on the front end so the default will work on the back end.
Thanks Bob
The text was updated successfully, but these errors were encountered:
Did some more research and found Jtar only writes with a factor of one. So I created my own copy of Jtar with a modification to TarOutputStream class that would allow a blocking factor.
Added
private int blockingFactor;
...changed
public void close() throws IOException {
closeCurrentEntry();
write(new byte[TarConstants.EOF_BLOCK]);
//Now pad it to a multiple of the blocking factor
int blkFacSize = TarConstants.DATA_BLOCK * blockingFactor;
write(new byte[blkFacSize - ((int) (bytesWritten % blkFacSize))]);
super.close();
}
...Added
public void setBlockingFactor(int factor) {
this.blockingFactor = factor;
}
I am using Jtar in an application to tar a directory of files in windows. Analysis of the file created indicates that it is using a blocking factor of 3.
The application that extracts (tar -xfv filename) runs on a hpux box and apparently uses the default block size of 20 but is giving me the error "Tar: tape blocksize error". And when I use tar bxfv -b 3 filename, it works.
The problem is I can't change the extract application to use that factor so I need to know how to do it with Jtar on the front end so the default will work on the back end.
Thanks Bob
The text was updated successfully, but these errors were encountered: