> Bytes from a working gzip it creates looks like this...
> 1F 8B 08 00 00 00 00 00 00 03 EC BD
>
> Bytes from a non-working gzip look like this...
> 1F EF BF BD 08 00 00 00 00 00 00 00 03 EF BF <- Red bytes should be 8B
>

This is the Unicode UTF8 "replacement character".  
    http://en.wikipedia.org/wiki/Replacement_character#Replacement_character
    https://www.google.com/search?q=EF%20BF%20BD
    https://www.google.com/search?q=0xEF+0xBF+0xBD

Somebody is not seeing your streamed data as binary.  I don't know why a 
UTF encoder/decoder would be called here.

I am not conversant with these NPM modules (fstream, etc.)  I am sure 
someone who has used these would know immediately if any flags need to be 
set in your calls.

On Friday, July 27, 2012 1:44:40 PM UTC-5, Joe Ferner wrote:
>
> Before posting an issue I wanted to discuss it here to make sure I'm doing 
> things correctly.
>
> What I'm seeing is occasional bad characters in my gzip file.
>
> Here is the code I use to create the file...
>
> var fstream = require('fstream');
> var tar = require('tar');
> var zlib = require('zlib');
>
> console.log("tar gzipping " + source + " -> " + dest);
> fstream.Reader({path: source, type: 'Directory'})
>   .pipe(tar.Pack())
>   .pipe(zlib.createGzip())
>   .pipe(fstream.Writer(dest));
>
> 9/10 this code works great. 1/10 it adds 3 additional bytes to the 
> beginning of the gzip file. Unfortunately it's happening 
> very inconsistently and I'm unable to reproduce it reliably. I'm running on 
> OSX using node 0.8.3.
>
> Bytes from a working gzip it creates looks like this...
> 1F 8B 08 00 00 00 00 00 00 03 EC BD
>
> Bytes from a non-working gzip look like this...
> 1F EF BF BD 08 00 00 00 00 00 00 00 03 EF BF <- Red bytes should be 8B
>
> If I change the three bytes above to 8B the file works again.
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to