TritonDataCenter / node-manta

Node.js SDK for Manta
75 stars 54 forks source link

Support for opts.mkdirs in createWriteStream #253

Closed chudley closed 2 years ago

chudley commented 8 years ago

Intends to fix #248 by making a call to client.put() and returning the stream, as opposed to re-implementing similar logic to client.put().

davepacheco commented 8 years ago

Thanks! This change looks good to me. As I read it, this will also pass through the "md5" option and "content-length", and may affect the "transfer-encoding" header as a result (which is fine, but wanted to mention it here). Would it be possible to add a test case as well?

chudley commented 8 years ago

Sure thing, I can get a test case in. Would you like it to cover the "md5" and "content-length" pass through options, or will a basic createWriteStream with mkdirs suffice?

Also, I'll have to look at the test suite a bit closer, but because we're attempting to create new objects and directories with this test, I believe I'll need to bump the number of expected objects that are used later in the suite (e.g. in the ls tests: https://github.com/joyent/node-manta/blob/master/test/client.test.js#L379).

There may be a way that I can squeeze into the already-created directory structure and avoid this, but if you don't see this as a concern then I'll go ahead with the bump.