Срд, 11 Авг 2010, Sherlock Ric писал(а):
> > From: Raul Miller
> > Sent: Wednesday, 11 August 2010 08:30
> > 
> > On Tue, Aug 10, 2010 at 4:06 PM, Sherlock, Ric
> > <[email protected]> wrote:
> > >> From: Raul Miller
> > >> tools/ftp/wget.exe from my copy of j (j602) corrupts the
> > >> file when I use -O- to get the file to appear on stdout.
> > >
> > > As noted here
> > > http://www.jsoftware.com/jwiki/Addons/web/gethttp#KnownIssues
> > > The problem seems to be that on Windows, directing the output to the
> > session causes LFs to be replaced by CRLFs, thereby corrupting binary
> > files.
> > 
> > Ok, so it's a known bug.
> > 
> > That said, the wget I normally use on windows does not have this
> > problem.  Of course it's almost 6mb with all its libraries, so I
> > do not recommend its use.  But we need something better
> > than a buggy wget.
> >
> > > A workaround is to retrieve the binary file and write to disk for
> > example:
> > >  'file' gethttp 'http://www.mydomain.com/myimage.jpg'
> > > and then read the file from disk into the session.
> > 
> > That's better than a bug, but... ick.
> 
> Agreed! 
> I'd certainly be in favour of the wget included with J not converting LFs to 
> CRLFs when outputting to stdout.

wget may have a good reason to use text mode for stdout such as piping
text files which could be either in unix or dos format. Changing
stdout to binary mode might cause other regressions. A safer
workaround (needed for window only) could be writing to a temporary
file, reading its content, and purging the file.

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to