This isn't pertinent to core node.js, but I'm hoping someone might be able to
give me a hand. I want to accomplish the equivalent of "tar -cf output.tar -C
/tmp/whatever ." with Isaac's fstream[1] and tar[2] modules. Unfortunately I
find the documentation really lacking; maybe I'm just missing something?
Here's essentially the code I'm using:
fstream.Reader({ path: "/tmp/path/to/root, type: "Directory" })
.pipe(tar.Pack())
.pipe(zlib.createGzip())
.pipe(fstream.Writer({
path: path.join("output.tar.gz"),
type: "File"
}));
This is based on a gist[3]. If "/tmp/path/to/root/file.js" is a file, then
output.tar.gz will contain the path "root/file.js", which is kind of weird.
What I want to do is modify the path to each file, but I don't know where to
start. I only have a rough grasp of streams, and I can't really figure out how
the data and metadata flow from the fstream.Reader. Does anyone have any
pointers?
Thanks,
Brian
[1]: https://github.com/isaacs/fstream
[2]: https://github.com/isaacs/node-tar
[3]: https://gist.github.com/nicolasfont/2040815
--
Brian Lalor
[email protected]
http://github.com/blalor
--
--
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
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.