Yeah. It was exactly the issue of not binmoding STDOUT.

Patch attached - it seems to fix the problem.

Fi.


On 10/16/06, Fi Dot <[EMAIL PROTECTED]> wrote:
On 10/16/06, Willener, Pat <[EMAIL PROTECTED]> wrote:
> What you describe looks like Windows ASCII mode. I thought (from the
> description on the wget site) that BINARY mode was the default?

Yup.

http://www.gnu.org/software/wget/manual/html_node/URL-Format.html

> Can you try to explicitly specify either type=I or type=a
> and see what you get?

Hmmm.... sincerely, I did not know that these kind of params exist :) Thanx.

However, the proto I am using is HTTP (not FTP, and the link above is
mentioning those suffixes in the context of FTP URLs!), and, AFAIK, it
does not do any separation between binary and text streams.

I tried those suffixes anyway, and they did not help :( As i was
expecting, wget was treating those as  a part of URL, and I was
getting 404s.

I will try to play with the code of wget tonight. Will give feedback
as soon as I get any results. I still think that's a bug :)

Fi.



>
>
> -----Original Message-----
> From: Fi Dot [mailto:[EMAIL PROTECTED]
> Sent: Saturday, October 14, 2006 2:17 AM
> To: [email protected]
> Subject: Weird behavour of wget on Win32 while outputting file to stdout
>
> Hi, many-respected all!
>
> Recently, playing with wget on win32 (version 1.10.2, downloaded from
> http://users.ugent.be/~bpuype/wget/ ), I have encountered a problem
> which I'd like to share with ya.
>
> When I do
>
> wget -O - http://foo/bar
>
> the stream I get on STDOUT is corrupt.
>
> Let's say, I do
>
> wget -O - http://foo/bar > bar.downloaded
>
> 'bar.downloaded' is slightly bigger than original 'bar'.
>
> Closer examination unveils:
>
> $ od -t x1 bar.downloaded
>
> 0000000 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48
> 0000020 44 52 00 00 01 8e 00 00 02 58 08 02 00 00 00 fa
> 0000040 e9 96 84 00 00 00 09 70 48 59 73 00 00 00 64 00
> 0000060 00 00 64 00 0f 96 c5 dd 00 00 00 46 74 45 58 74
>
> $ od  -t x1 bar
>
> 0000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52
> 0000020 00 00 01 8e 00 00 02 58 08 02 00 00 00 fa e9 96
> 0000040 84 00 00 00 09 70 48 59 73 00 00 00 64 00 00 00
> 0000060 64 00 0f 96 c5 dd 00 00 00 46 74 45 58 74 52 61
>
> that all 0x0As get preceded with 0x0Ds.
>
> I think that's a bug in the code (I have not found a command line
> option that does that) - it's not binmoding STDOUT. That's my guess.
>
> I will appreciate any comments :)
>
> Thx!
>
> Fidot.
>

Attachment: stdout.patch
Description: Binary data

Reply via email to