andreasgal/j2me.js — pull request #355 by mykmelez (2014-09-27 08:40:31+00:00)
Title: truncate files that exist but are empty; create files with Blob

With all exceptions being printed, I noticed a midlet having trouble writing to a file. It turned out that the file had a stat, but it didn't have a content blob, so *fs.exists* would return `true`, which caused the API in question to call *fs.truncate*, which failed, returning `false`, because the file didn't have a content blob.

This changeset does two things:

1. Makes *truncate* use *exists* to determine whether or not the file exists.
2. Fixes two cases where *fs.create* is being called with the wrong second parameter, which should be a Blob.