Version: 2.6.1 (using KDE 3.5.1-1.5.fc4.kde, Fedora Core release 4 (Stentz)) Compiler: Target: i386-redhat-linux OS: Linux (i686) release 2.6.15-1.1830_FC4smp When opening a file.Z on a system with no 'compress' utility, Ark report an error, and does not open the compressed file. The file, however, opens with gunzip. I would expect Ark to try 'gunzip' if 'compress' is not available.
Can you attach a test .Z file?
We could have 2 approaches here: the first (the one i prefer) is to drop support for compress entirely and use gzip to compress/decompress .Z files. Gentoo doesn't even have "compress" anymore. The second is to search for compress and if its not found to use the gzip utility. What do you think?
First, as for .Z files: search for "ps.Z" files. http://www.google.com/search?hl=en&q=ps.Z Second, the second approach seems more appropriate, but on the price of intoducing complication. The first option is simple and easy to implement. As 'compress' files are rare, and as gunzip would open any .Z file (I think), I would go for the first approach. Simply use gzip.
Created attachment 14750 [details] Replace compress with gzip Ok, quick patch: replaces compress and uncompress with gzip and gunzip. Tested on my system works perfectly. I can do a new patch for the second case but i think it adds unneccessary complication
SVN commit 510942 by henrique: * Use gzip/gunzip if compress/uncompress are not available. Based on patch by Henry Kay <haris@mpa.gr> BUG: 121601 M +4 -3 compressedfile.cpp --- branches/KDE/3.5/kdeutils/ark/compressedfile.cpp #510941:510942 @@ -44,6 +44,7 @@ #include <kio/global.h> #include <kfileitem.h> #include <kapplication.h> +#include <kglobal.h> // ark includes #include "arkwidget.h" @@ -129,9 +130,9 @@ } if ( mimeType == "application/x-compress" ) { - m_unarchiver_program = "uncompress"; - m_archiver_program = "compress"; - m_defaultExtensions = ".Z"; + m_unarchiver_program = KGlobal::dirs()->findExe( "uncompress" ).isNull()? "gunzip" : "uncompress"; + m_archiver_program = KGlobal::dirs()->findExe( "compress" ).isNull()? "gzip" : "compress"; + m_defaultExtensions = ".Z"; } }
>List: kde-commits >Subject: branches/KDE/3.5/kdeutils/ark > From: Henrique Pinto <henrique.pinto () kdemail ! net> >Date: 2006-02-18 14:53:08 >Message-ID: 1140274388.563557.29024.nullmailer () svn ! kde ! org > >SVN commit 510942 by henrique: > > * Use gzip/gunzip if compress/uncompress are not available. > Based on patch by Henry Kay <haris@mpa.gr> > BUG: 121601 You are aware that gzip *cannot* create files compatible to compress, aren't you? Only gunzip can uncompress some non-gzip files (if compiled so), including files created by compress. > > > > M +4 -3 compressedfile.cpp Have a nice day!
SVN commit 515688 by henrique: * According to Nicolas Goutte, gzip cannot create compress-compatible files. CCBUG: 121601 M +1 -1 compressedfile.cpp --- branches/KDE/3.5/kdeutils/ark/compressedfile.cpp #515687:515688 @@ -132,7 +132,7 @@ if ( mimeType == "application/x-compress" ) { m_unarchiver_program = KGlobal::dirs()->findExe( "uncompress" ).isNull()? "gunzip" : "uncompress"; - m_archiver_program = KGlobal::dirs()->findExe( "compress" ).isNull()? "gzip" : "compress"; + m_archiver_program = "compress"; m_defaultExtensions = ".Z"; }