public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: uudecode?
@ 1999-01-31 23:52 Mark Newnham
  1999-01-31 23:52 ` uudecode? $Bill Luebkert
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Newnham @ 1999-01-31 23:52 UTC (permalink / raw)
  To: 'John Cooper'; +Cc: mh, gnu-win32

The problem appears to be with the uuencode portion, because a file
encoded on a different system will uudecode correctly with the source
supplied.

If you compare a file encoded with the source code, against the same
file encoded on a Unix system, although the files are the same size,
each line on the Unix encoded file starts with a 'M' (or possibly the
'M' is after the newline on the previous. This does not appear with the
source code version.

Also when an attempt is made to decode a file uuencoded with the source
code version on a Unix system, the error "No end line" appears.

Excuse me for not being able to offer a solution, but this information
might help those more capable than myself..... 


Mark Newnham
Application Design Associates, Inc
6021 S.Syracuse Way #302
Englewood, CO 80111, USA
+1 303 779  8958


	-----Original Message-----
	From:	John Cooper [SMTP:John.Cooper@citrix.com]
	Sent:	Tuesday, January 19, 1999 7:40 AM
	To:	mark@adacorp.com
	Cc:	'John Cooper'; mh@mike.franken.de; gnu-win32@cygnus.com
	Subject:	Re: uudecode?

	Bernard Dautrevaux <DAUTREVAUX@microprocess.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)

	    --- John

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: uudecode?
@ 1999-01-31 23:52 Lincoln, W. Terry
  0 siblings, 0 replies; 23+ messages in thread
From: Lincoln, W. Terry @ 1999-01-31 23:52 UTC (permalink / raw)
  To: John Cooper, 'gnu-win32 mail list'

[-- Attachment #1: Type: text/plain, Size: 2927 bytes --]

All,

The source code that was submitted uses an uninitialized variable and it   
will generate garbage on some compilers.
See:
 ------------------------------------------------------cut here:   
uuencode.c
#include <stdio.h>
#define ENC(c) ((c) ? ((c) & 077) + ' ': '`')
static int uuencode(char *nom)  /* nom means 'name' in french :-) */
{
    int ch, n, idx;
/*      ^^
**  Declaration */
    register char *p;
    char buf[80], outbuf[250];
    FILE *in;

    if ((in = fopen(nom, "rb")) == NULL)
        return 1;  /* please add some error checking/reporting */
    printf("begin 0666 %s\n",nom);/* note: no attempt to fake any   
permissions
*/
    while ((n = fread(buf, 1, 45, in)) != 0) {
        idx = 0;
        outbuf[idx++] = ENC(ch);
/*                          ^^ first use.
    Where is first initialization? */
        for (p = buf; n > 0; n -= 3, p += 3) {
            ch = *p >> 2;
            ch = ENC(ch);
            outbuf[idx++] = ch;
            ch = ((*p << 4) & 060) | ((p[1] >> 4) & 017);
            ch = ENC(ch);
            outbuf[idx++] = ch;
            ch = ((p[1] << 2) & 074) | ((p[2] >> 6) & 03);
            ch = ENC(ch);
            outbuf[idx++] = ch;
            ch = p[2] & 077;
            ch = ENC(ch);
            outbuf[idx++] = ch;
        }
        outbuf[idx++] = '\n';
        outbuf[idx] = 0;
        printf("%s", outbuf);
    }
    printf("%c\nend\n", ENC(0));
    fclose(in);
    return 0;
}

W. Terry Lincoln                    \     \ | | /
Senior Engineer                      \     _| |_
Ultimate Technology Corporation       \   |_   _|
division of Tridex(NASDAQ/trdx)        \    | |
WTerryLincoln@engineer.com              \ / | | \
http://www.angelfile.com/ny/TerryLincoln \  | |
==========================================  ~~~
Opinions expressed do not represent the management
of UTC.



 -----Original Message-----
From: John Cooper [ mailto:John.Cooper@citrix.com ]
Sent: Wednesday, January 20, 1999 2:23 PM
To: root
Cc: John Cooper; gnu-win32
Subject: Re: uudecode?


 ----------------------------------------------------
root@jacob.remcomp.fr (root) writes:

 > Let's stop this uuencode/decode discussion.  Here are two small little
 > programs in that old but powerful language we all know somehow.

This source simply doesn't work for me - it generates all sorts of   
different
characters at the beginning of encoded lines, rather than the "M" that I   
see
with most uuencoders.

I finally pulled over the sharutils-4.2 source, got that to build under   
NT and
then carefully enabled (or disabled) the binary flag on the fopen calls.   
 It
now seems to work fine - without mucking with mounts or using bash (I   
prefer
zsh).

Thanks for all the ideas...

    --- John

 -
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
[[ WARREN~1.VCF : 3851 in WARREN~1.VCF ]]  

[-- Attachment #2: WARREN~1.VCF --]
[-- Type: text/vcard, Size: 744 bytes --]

BEGIN:VCARD
VERSION:2.1
N:Lincoln;Warren;;Mr.;
FN:Warren Terry Lincoln (E-mail)
ORG:UTC;Engineering
TITLE:Senior Engineer
TEL;WORK;VOICE:(716) 924-9500
TEL;HOME;VOICE:(716) 377-3959
TEL;CELL;VOICE:(716) 261-3959
TEL;CAR;VOICE:
TEL;WORK;FAX:(716) 924-1434
ADR;WORK:;Victor;100 Rawson Road;Victor;NY;14564-0000;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Victor=0D=0A100 Rawson Road=0D=0AVictor, NY 14564-0000=0D=0AUnited States of=
 America
ADR;HOME:;;100 Courtshire Lane;Penfield;NY;10526-2678;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:100 Courtshire Lane=0D=0APenfield, NY 10526-2678=0D=0AUnited States of Ameri=
ca
EMAIL;PREF;MS:ULTIMATE/UTCPO/LincolnT
REV:19990121T133603Z
END:VCARD

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: uudecode?
@ 1999-01-31 23:52 Bernard Dautrevaux
  1999-01-31 23:52 ` uudecode? John Cooper
  0 siblings, 1 reply; 23+ messages in thread
From: Bernard Dautrevaux @ 1999-01-31 23:52 UTC (permalink / raw)
  To: 'John Cooper', mh; +Cc: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

> -----Message d'origine-----
> De:	John Cooper [SMTP:John.Cooper@citrix.com]
> Date:	lundi 18 janvier 1999 11:33
> À:	mh@mike.franken.de
> Cc:	gnu-win32@cygnus.com
> Objet:	Re: uudecode?
> 
> mh@mike.franken.de (Michael Hirmke) writes:
> 
>  > >Can anyone point me to a reliable version of the command line
>  > >uudecode.exe/uuencode.exe utilities for NT 4.0?
>  > 
>  > Don't know, what you mean by reliable, but you can get the
> sharutils-4.2c
>  > package, which contains uuencode/uudecode among other utilities
> 
> These just don't work at all:
> 
>   $ cp c:/WINNT/NOTEPAD.EXE n.exe
>   $ ./n.exe      # works fine!
>   $ uuencode n.exe n.exe > n.uu
>   $ rm n.exe
>   $ ls n.*
>   n.uu
>   $ uudecode n.uu
>   $ ls n.*
>   n.exe*  n.uu
>   $ ./n.exe
>   zsh: exec format error: .\n.exe
>   $
>   $ ls -l n.exe
>   -rwxrwxrwx   1 JCooper          Domain_Users      594 Jan 18 10:37
> n.exe*
>   $
> 
> Any ideas what's wrong with it?
> 
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...

Regards,

		Bernard
>  
------------------------------------------------------------------------
------
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@microprocess.com
	b.dautrevaux@usa.net
------------------------------------------------------------------------
------
>  
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: uudecode?
@ 1999-01-31 23:52 Tom St Denis
  0 siblings, 0 replies; 23+ messages in thread
From: Tom St Denis @ 1999-01-31 23:52 UTC (permalink / raw)
  To: John Cooper, gnu-win32

>Can anyone point me to a reliable version of the command line
>uudecode.exe/uuencode.exe utilities for NT 4.0?

try

http://members.tripod.com/~tomstdenis/uuencode.com
http://members.tripod.com/~tomstdenis/uudecode.com


They are DOS .com binaries

Tom
+--------------------------------------------------------------------------+
| The coolest site for free home pages, email, chat, e-cards, movie info.. |
|               http://www.goplay.com - it's time to Go Play!              |
+--------------------------------------------------------------------------+
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: uudecode?
@ 1999-01-31 23:52 N8TM
  0 siblings, 0 replies; 23+ messages in thread
From: N8TM @ 1999-01-31 23:52 UTC (permalink / raw)
  To: John.Cooper, gnu-win32

In a message dated 1/15/99 4:56:50 PM Pacific Standard Time,
John.Cooper@citrix.com writes:

<< Can anyone point me to a reliable version of the command line
 uudecode.exe/uuencode.exe utilities for NT 4.0? >>
Those are part of the gnu sharutils package, and they have worked fine for me
when built normally under cygwin.  I have had some difficulties with more
complicated usage of sharutils, however.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: uudecode?
@ 1999-01-31 23:52 Earnie Boyd
  0 siblings, 0 replies; 23+ messages in thread
From: Earnie Boyd @ 1999-01-31 23:52 UTC (permalink / raw)
  To: John Cooper, root; +Cc: gnu-win32, john.cooper

---John Cooper <John.Cooper@citrix.com> wrote:
8<
> If nobody has a solution, I guess I'll try debugging it when I get
time.

Well, maybe.

> 
>     --- John
> 
>   $ cp c:/winnt/NOTEPAD.EXE n.exe
>   $ ls -l n.exe
>   -rwxrwxrwx   1 JCooper          Domain_Users    45328 Jan 19 10:28
n.exe*
>   $
>   $ ./uuencode n.exe n.exe > n.uu

This is the AhHa!!  Try `SET CYGWIN=binmode' before starting bash.

If this fixes the problem then the program needs to change the mode of
the stdout so that it is also binary.  Note you probably should change
the stdin as well.


==
-                        \\||//
-------------------o0O0--Earnie--0O0o-------------------
--                earnie_boyd@yahoo.com               --
-- http://www.freeyellow.com/members5/gw32/index.html --
----------------------ooo0O--O0ooo----------------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: uudecode?
@ 1999-01-31 23:52 Bernard Dautrevaux
  0 siblings, 0 replies; 23+ messages in thread
From: Bernard Dautrevaux @ 1999-01-31 23:52 UTC (permalink / raw)
  To: 'John Cooper', Bernard Dautrevaux; +Cc: mh, gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

> -----Message d'origine-----
> De:	John Cooper [SMTP:John.Cooper@citrix.com]
> Date:	mardi 19 janvier 1999 15:40
> À:	Bernard Dautrevaux
> Cc:	'John Cooper'; mh@mike.franken.de; gnu-win32@cygnus.com
> Objet:	Re: uudecode?
> 
> Bernard Dautrevaux <DAUTREVAUX@microprocess.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@microprocess.com
		b.dautrevaux@usa.net
------------------------------------------------------------------------
------


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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* uudecode?
@ 1999-01-31 23:52 John Cooper
  1999-01-31 23:52 ` uudecode? Michael Hirmke
  1999-01-31 23:52 ` uudecode? Corinna Vinschen
  0 siblings, 2 replies; 23+ messages in thread
From: John Cooper @ 1999-01-31 23:52 UTC (permalink / raw)
  To: gnu-win32

Can anyone point me to a reliable version of the command line
uudecode.exe/uuencode.exe utilities for NT 4.0?

Thanks,

    --- John

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* uudecode?
@ 1997-09-09 23:33 John Cooper
  1997-09-10 10:28 ` uudecode? root
  0 siblings, 1 reply; 23+ messages in thread
From: John Cooper @ 1997-09-09 23:33 UTC (permalink / raw)
  To: GNU-Win32

Can anyone point me to an NT version of the unix "uudecode" program?

Thanks,

    --- John

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <root@jacob.remcomp.fr's>]

end of thread, other threads:[~1999-01-31 23:52 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-31 23:52 uudecode? Mark Newnham
1999-01-31 23:52 ` uudecode? $Bill Luebkert
  -- strict thread matches above, loose matches on Subject: below --
1999-01-31 23:52 uudecode? Lincoln, W. Terry
1999-01-31 23:52 uudecode? Bernard Dautrevaux
1999-01-31 23:52 ` uudecode? John Cooper
1999-01-31 23:52   ` uudecode? Anil K Ruia
1999-01-31 23:52   ` uudecode? Benjamin Riefenstahl
1999-01-31 23:52 uudecode? Tom St Denis
1999-01-31 23:52 uudecode? N8TM
1999-01-31 23:52 uudecode? Earnie Boyd
1999-01-31 23:52 uudecode? Bernard Dautrevaux
1999-01-31 23:52 uudecode? John Cooper
1999-01-31 23:52 ` uudecode? Michael Hirmke
1999-01-31 23:52   ` uudecode? John Cooper
1999-01-31 23:52     ` uudecode? root
1999-01-31 23:52       ` uudecode? John Cooper
1999-01-31 23:52         ` uudecode? John Cooper
1999-01-31 23:52       ` uudecode? John Cooper
1999-01-31 23:52         ` uudecode? Pierre A. Humblet
1999-01-31 23:52     ` uudecode? Glenn Spell
1999-01-31 23:52 ` uudecode? Corinna Vinschen
1997-09-09 23:33 uudecode? John Cooper
1997-09-10 10:28 ` uudecode? root
     [not found] <root@jacob.remcomp.fr's>
     [not found] ` <message>
     [not found]   ` <of>
     [not found]     ` <"Mon,>
     [not found]       ` <18>
     [not found]         ` <Jan>
     [not found]           ` <1999>
     [not found]             ` <19:42:30>
     [not found]               ` <+0100>

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).