damballa / parkour

Hadoop MapReduce in idiomatic Clojure.
Apache License 2.0
257 stars 19 forks source link

fixed with-copies* #20

Closed stanfea closed 9 years ago

llasram commented 9 years ago

Could you explain a little more about what incorrect behavior you're seeing which your change fixes?

stanfea commented 9 years ago

Wasn't working was creating 0 byte files. Seems like an oversight since all the required code was in do-copy also it says io/copy is private and it wasn't passing the third opts paramater

llasram commented 9 years ago

The io/copy function is the Clojure standard library public interface, while do-copy is the (for some reason private) implementation multimethod. The call to io/copy was intentional, going through the public interface when possible. There's no opts to pass in because the current implementation first opens input and output streams itself, leaving to io/copy the job of just plumbing around the bytes.

This function as-is has a passing test, although it certainly isn't exhaustive (for one thing it doesn't even test passing in an explicit config). Would you mind adding to that test a case demonstrating the bug you are seeing in the current implementation?

stanfea commented 9 years ago

working now. the problem was with something I fixed afterward. Sorry for the mixup!

llasram commented 9 years ago

No problem. FWIW BTW, most of the uses I had for this function have been replaced with dvals. If you haven't used them yet, it might be worth a look.