mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
406 stars 92 forks source link

always pass emptyStream when type is directory #69

Closed nlf closed 7 years ago

nlf commented 7 years ago

closes #68

simplest possible fix without losing information

mafintosh commented 7 years ago

Curious, you har a tar that has a directory entry with size but no content in the tar? Sounds invalid, but I can merge this anyway. Just want to make sure I'm not missing anything.

nlf commented 7 years ago

as i mentioned in #68:

On systems where disk allocation is performed on a directory basis, the size field will contain the maximum number of bytes (which may be rounded to the nearest disk block allocation unit) which the directory may hold. A size field of zero indicates no such limiting. Systems which do not support limiting in this manner should ignore the size field.

it just so happens we came across a tarball that was created on a system that allows for this, and since tar-stream doesn't write directly to disk anyway it seemed the correct behavior was to disregard the size field for directories.

mafintosh commented 7 years ago

Makes sense. I'll release when I get back from lunch On Thu, 11 May 2017 at 16.02, Nathan LaFreniere notifications@github.com wrote:

as i mentioned in #68 https://github.com/mafintosh/tar-stream/issues/68:

On systems where disk allocation is performed on a directory basis, the size field will contain the maximum number of bytes (which may be rounded to the nearest disk block allocation unit) which the directory may hold. A size field of zero indicates no such limiting. Systems which do not support limiting in this manner should ignore the size field.

it just so happens we came across a tarball that was created on a system that allows for this, and since tar-stream doesn't write directly to disk anyway it seemed the correct behavior was to disregard the size field for directories.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mafintosh/tar-stream/pull/69#issuecomment-300798770, or mute the thread https://github.com/notifications/unsubscribe-auth/AAW_VQKGvA0Five2FHoMFJfCy2Ci3nTuks5r4xTcgaJpZM4NL9dv .

mafintosh commented 7 years ago

1.5.4, Thanks!