Feature request & patch: append to file objects
It would be nice if we could append to a file. I wanted to work around the fact that httpclient is memory-backed by downloading parts of the file at a time and stitching them back up together, but I wasn't able to do that with the standard API.
If other people need appending, here's a quick hack which adds it on the iphone. I don't expect the patch to be included as-is as it only implements the blob case.
http://github.com/dae/titanium_mobile/commit/11ea23f673da28a3e406469edaff5a171dfabd37
2 Answers
-
Gawd Bless you, Sir!
I needed to do exactly this, for the exact reasons you said (grabbing a big file without the HTTPClient pooping itself).
Great patch, and I would highly recommend that we get an official patch (+Android) for this. What do you say, appcelerator dudes - sneak it in for 1.4? Damien's already done most of the iPhone bit for you!
~A
-
They did include this patch in the dev code. On Android you can call .write(data, true) to append, so it's now possible on all platforms.