• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to open .lzh file created in UNIX using lha.jar  RSS feed

 
PraveenKumar Kannankutty
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I am now using a third party tool called lha.jar to open an .lzh file.This is working fine when the .lzh file created in windows is processed. The same fails when i try to open and read an .lzh file created in UNIX environment. Can someone please help me out for the same.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does it fail? What error messages do you get? What program are you using to create the archive (the original lzh program in both cases or something else)?
 
PraveenKumar Kannankutty
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using java for passing the file to LhaFile, which is a class file in Lha.jar. It opens the file and reads the content with the header inforation. Incase of an .lzh file created in unix it is unable to read and so it throws an exception saying that "header is broken", probably the header information varies in UNIx with respect to Windows.
I hope this is clear to you.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the header shouldn't differ AFAIK. Unless perhaps there are different versions (or different compression algorithms) being used. Perhaps you can create the file again on the unix machine, but disable compression (use the 'store' switch) and see if that works.

Does your standard Windows tool (the one you created the lzh with) read the unix lzh OK?
 
Matthew Taylor
Rancher
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe this is a stupid question, but are you accounting for line breaks vs. carraige returns?
 
PraveenKumar Kannankutty
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The current system that opens the .lzh file(created in Windows) is unable to open the one created in UNIX.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter: I thought of that, but surely line breaks an such shouldn't be an issue in such a cross-platform file format? I would have thought the specification would have taken care of which to use.
 
Matthew Taylor
Rancher
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have had issues with line breaks vs. carriage returns using java before. You might want to investigate the issue.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!