Tane Piper wrote:
[...]
>                               File k = new File(j, rowId + ".jpg");
>                               k.mkdirs();
>                               k.createNewFile();
[...]
> However, it keeps failing on the line k.createNewFile(); with the
> error:
> WARN/System.err(10727): java.io.IOException: Parent of file is not a
> directory: /sdcard/twitcast/1.jpg

It looks like there's a file on your SD card called '/sdcard/twitcast'
that's preventing the directory from being created. Is File.mkdirs()
returning non-zero? (Remember that it doesn't throw an IOException on
error.)

Also, in the interests of pedantry, it's a good idea to close your
FileOutputStream after use --- while the garbage collector will take
care of it *eventually*, leaving the file open may cause you problems
later if you need to open the file again.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "A line dancer near a graduated cylinder, the blithe spirit inside
│ some wheelbarrow, and a tomato are what made America great!" ---
│ received via spam

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to