Mail Archives: djgpp/1997/02/11/02:04:31
On 10 Feb 1997, Andy Eskilsson wrote:
> I was messing around with gzip (gzp124b.zip), and got a bit mad
> because of the way it handled long filenames..
>
> Doing gzip on a file "longfilename.longext", resulted in
> "longfilename.longegz" and unpacking it I got a file
> "longfilename.longe".
>
> It would be nice to have long filenames working OK under win95..
Please note that patches to gzip that make this possible were posted to
this news group a couple of weeks ago. You can find them by searching
the DJGPP mail archives at the URL below for the word "gzip":
http://www.delorie.com/djgpp/mail-archives/
> definitions, but if it is possible to detect if long filenames is
> supported during runtime, it could probably be possible to add some
> small code to do this and choose the apropriate method of naming?
DJGPP has a function to detect at runtime whether LFN is supported. All
the low-level library functions call that function to decide whether they
should use the new LFN API functions for file-oriented DOS calls instead
of the legacy DOS functions. An application that needs to change its
behavior (like in the case of gzip) as a result of LFN support (or lack
thereof) should call that function also. The function is called
`_use_lf' (but it is better to use the macro `_USE_LFN' defined on
<fcntl.h>) and is documented in the DJGPP library reference, which see.
> Duuh shortly, I believe it is a bug that the gzip in the distribution
> doesn't support long filenames properly, guess it is FSF's issue, but
> until then, solutions?
No, this is not an FSF bug, but rather a bug in the DJGPP port of gzip.
The original gzip code doesn't do anything fancy with the filenames, it
just appends .gz to any filename it gets on the command line. The
trickery that you described is done by the DOS-specific code added to
gzip for the DOS port (since plain DOS doesn't allow multiple dots in the
filename). With the addition of the LFN support to DJGPP, that code
needs to be rewritten so that only when LFN is NOT supported the
filenames are changed; when LFN is supported, they should be left alone.
- Raw text -