Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
fritz.mueller

Homepage

Munich, Germany,
03.01.2024, 20:16
 

lzip: Can't create output file (Users)

Hi,
I just wrote the help version of lzip and noticed that there is a problem with 8.3.
When I try lzip abcdefgh.123 I get an error message:
Can't create output file abcdefgh.123.lz

It only works when I activate doslfn.

Is there a workaround? Am I right, when I say that lzip is almost unusable for DOS?

rr

Homepage E-mail

Berlin, Germany,
03.01.2024, 22:54

@ fritz.mueller
 

lzip: Can't create output file

> Hi,
> I just wrote the help version of lzip and noticed that there is a problem
> with 8.3.
> When I try lzip abcdefgh.123 I get an error message:
> Can't create output file abcdefgh.123.lz

Uh, is that my old "lzip 1.20" build from 2018? :-D

> It only works when I activate doslfn.
>
> Is there a workaround? Am I right, when I say that lzip is almost unusable
> for DOS?

Help says: -o, --output=<file>

Usage is: lzip -o abcdefgh.lz abcdefgh.123

---
Forum admin

fritz.mueller

Homepage

Munich, Germany,
04.01.2024, 13:53

@ fritz.mueller
 

lzip: Can't create output file

> Hi,
> I just wrote the help version of lzip and noticed that there is a problem
> with 8.3.
> When I try lzip abcdefgh.123 I get an error message:
> Can't create output file abcdefgh.123.lz
>
> It only works when I activate doslfn.
>
> Is there a workaround? Am I right, when I say that lzip is almost unusable
> for DOS?

Still not sure what I do wrong. Sorry for so many pictures, but I hope it clears what I am talking about.

[image]

[image]

[image]

[image]

tom

Homepage

Germany (West),
04.01.2024, 16:10

@ fritz.mueller
 

lzip: Can't create output file

> Still not sure what I do wrong. Sorry for so many pictures, but I hope it
> clears what I am talking about.
>
attrib uninstall.lz -r

rr

Homepage E-mail

Berlin, Germany,
04.01.2024, 20:07

@ fritz.mueller
 

lzip: Can't create output file

> Still not sure what I do wrong. Sorry for so many pictures, but I hope it
> clears what I am talking about.

I can confirm this behavior on my system for my lzip 1.9 and lzip 1.20 ports. :-(

-o or --output=file only works when reading from stdin, as the help screen says.

When reading from a file, lzip always takes the input file name and appends .lz.

---
Forum admin

rr

Homepage E-mail

Berlin, Germany,
04.01.2024, 20:14

@ rr
 

lzip: Can't create output file

> > Still not sure what I do wrong. Sorry for so many pictures, but I hope
> it
> > clears what I am talking about.
>
> I can confirm this behavior on my system for my lzip 1.9 and lzip 1.20
> ports. :-(
>
> -o or --output=file only works when reading from
> stdin, as the help screen says.
>
> When reading from a file, lzip always takes the input file name and appends
> .lz.

From main.cc:

const struct { const char * from; const char * to; } known_extensions[] = {
  { ".lz",  ""     },
  { ".tlz", ".tar" },
  { 0,      0      } };

[...]

void set_c_outname( const std::string & name, const bool force_ext,
                    const bool multifile )
  {
  output_filename = name;
  if( multifile ) output_filename += "00001";
  if( force_ext || multifile || extension_index( output_filename ) < 0 )
    output_filename += known_extensions[0].from;
  }

[...]

---
Forum admin

rr

Homepage E-mail

Berlin, Germany,
04.01.2024, 23:10

@ rr
 

lzip: Can't create output file

> > Still not sure what I do wrong. Sorry for so many pictures, but I hope
> it
> > clears what I am talking about.
>
> I can confirm this behavior on my system for my lzip 1.9 and lzip 1.20
> ports. :-(
>
> -o or --output=file only works when reading from
> stdin, as the help screen says.
>
> When reading from a file, lzip always takes the input file name and appends
> .lz.

Wait! It's not completely unusable.
The solution is already noted above:

Compress: lzip -k -o example < example.exe
-> This will create example.lz.

Decompress: lzip -k -d -o example2.exe < example.lz

Note the redirection operators <.

---
Forum admin

fritz.mueller

Homepage

Munich, Germany,
04.01.2024, 23:23

@ rr
 

lzip: Can't create output file

> > > Still not sure what I do wrong. Sorry for so many pictures, but I hope
> > it
> > > clears what I am talking about.
> >
> > I can confirm this behavior on my system for my lzip 1.9 and lzip 1.20
> > ports. :-(
> >
> > -o or --output=file only works when reading
> from
> > stdin, as the help screen says.
> >
> > When reading from a file, lzip always takes the input file name and
> appends
> > .lz.
>
> Wait! It's not completely unusable.
> The solution is already noted above:
>
> Compress: lzip -k -o example < example.exe
> -> This will create example.lz.
>
> Decompress: lzip -k -d -o example2.exe < example.lz
>
> Note the redirection operators <.

Ok, thanks for this information, I will modify the help file, but how do you know a year later that this file was an exe file and not a gif?
Especially if you have a gif and a pdf and an exe file with the same name in the same folder as it is, eg, in vim?

fritz.mueller

Homepage

Munich, Germany,
04.01.2024, 23:29

@ fritz.mueller
 

lzip: Can't create output file

> > > > Still not sure what I do wrong. Sorry for so many pictures, but I
> hope
> > > it
> > > > clears what I am talking about.
> > >
> > > I can confirm this behavior on my system for my lzip 1.9 and lzip 1.20
> > > ports. :-(
> > >
> > > -o or --output=file only works when reading
> > from
> > > stdin, as the help screen says.
> > >
> > > When reading from a file, lzip always takes the input file name and
> > appends
> > > .lz.
> >
> > Wait! It's not completely unusable.
> > The solution is already noted above:
> >
> > Compress: lzip -k -o example < example.exe
> > -> This will create example.lz.
> >
> > Decompress: lzip -k -d -o example2.exe < example.lz
> >
> > Note the redirection operators <.
>
> Ok, thanks for this information, I will modify the help file, but how do
> you know a year later that this file was an exe file and not a gif?
> Especially if you have a gif and a pdf and an exe file with the same name
> in the same folder as it is, eg, in vim?
The only way to handle it is to create tar.lz?

rr

Homepage E-mail

Berlin, Germany,
07.01.2024, 17:17

@ fritz.mueller
 

lzip: Can't create output file

> > Ok, thanks for this information, I will modify the help file, but how do
> > you know a year later that this file was an exe file and not a gif?
> > Especially if you have a gif and a pdf and an exe file with the same
> > name in the same folder as it is, eg, in vim?
>
> The only way to handle it is to create tar.lz?

You're on the right track. The preferred way to use lzip is to compress containers.
So, at first, you tar your desired files into a .tar archive, then create a .tlz from this tar container.

---
Forum admin

fritz.mueller

Homepage

Munich, Germany,
07.01.2024, 18:09

@ rr
 

lzip: Can't create output file

> > > Ok, thanks for this information, I will modify the help file, but how
> do
> > > you know a year later that this file was an exe file and not a gif?
> > > Especially if you have a gif and a pdf and an exe file with the same
> > > name in the same folder as it is, eg, in vim?
> >
> > The only way to handle it is to create tar.lz?
>
> You're on the right track. The preferred way to use lzip is to compress
> containers.
> So, at first, you tar your desired files into a .tar archive,
> then create a .tlz from this tar container.

Thanks for feedback!

rr

Homepage E-mail

Berlin, Germany,
07.01.2024, 17:12

@ fritz.mueller
 

lzip: Can't create output file

> > Wait! It's not completely unusable.
> > The solution is already noted above:
> >
> > Compress: lzip -k -o example < example.exe
> > -> This will create example.lz.
> >
> > Decompress: lzip -k -d -o example2.exe < example.lz
> >
> > Note the redirection operators <.
>
> Ok, thanks for this information, I will modify the help file, but how do
> you know a year later that this file was an exe file and not a gif?
> Especially if you have a gif and a pdf and an exe file with the same name
> in the same folder as it is, eg, in vim?

lzip can't remove the DOS 8.3 limitation. So, this is left as an exercise to the user. ;-) One could rename example.lz to example.xlz for an .exe file.

---
Forum admin

Back to index page
Thread view  Board view
22049 Postings in 2034 Threads, 396 registered users, 194 users online (0 registered, 194 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum