delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/21/01:58:42

From: DAUTREVAUX AT microprocess DOT com (Bernard Dautrevaux)
Subject: RE: uudecode?
21 Jan 1999 01:58:42 -0800 :
Message-ID: <8135911A809AD211AF6300A02480D1750348C8.cygnus.gnu-win32@IIS000.microdata.fr>
Mime-Version: 1.0
To: "'John Cooper'" <John DOT Cooper AT citrix DOT com>,
Bernard Dautrevaux
<DAUTREVAUX AT microprocess DOT com>
Cc: mh AT mike DOT franken DOT de, gnu-win32 AT cygnus DOT com

> -----Message d'origine-----
> De:	John Cooper [SMTP:John DOT Cooper AT citrix DOT com]
> Date:	mardi 19 janvier 1999 15:40
> À:	Bernard Dautrevaux
> Cc:	'John Cooper'; mh AT mike DOT franken DOT de; gnu-win32 AT cygnus DOT com
> Objet:	Re: uudecode?
> 
> Bernard Dautrevaux <DAUTREVAUX AT microprocess DOT com> writes:
> 
>  > I'm not sure, but I'll bet that you have to sligthly change the
> uudecode
>  > source code to ensure that the open of the output file is done in
> binary
>  > mode : open(... O_BINARY) or fopen(..., "wb")). Your problem is
> most surely
>  > this infamous text!=binary feature :-( of Losedows...
> 
> It already does this - is there a known problem with `fopen'?  Do I
> need to use
> `open' instead?
> 
> 4 lines matching "open" in buffer uudecode.c.
>     9:    FILE *out, *in = fopen(fname, "rb");
>    11:        fprintf(stderr,"Impossible to open %s\n",fname);
>    33:    out = fopen(outname, "wb");
>    35:        fprintf(stderr,"Impossible to open %s\n",outname);
> 
> 1 line matching "open" in buffer uuencode.c.
>    10:    if ((in = fopen(nom, "rb")) == NULL)
> 
> 
Oh yes but all opens are done in binary mode.. What I imply is that
opens of binary files (input for uuencode and output for uudecode) must
use binary mode; however opens of text files (output of uuencode and
input of uudecode) should be in text mode, and anyway most surely the
output of uuencode is in text mode, as this is simply stdout, that all C
run-times assume (unless special settings in the environment or your
program) that stdin, stdout and stderr should be opened in text mode...

What properly happens is that at some point uudecode, which read text in
binary mode, get a raw ^M at end of line, and then either go wild or
just stop...

------------------------------------------------------------------------
------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux AT microprocess DOT com
		b DOT dautrevaux AT usa DOT net
------------------------------------------------------------------------
------


>  
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019