The new directory permission is set to the permission of the last
existing directory in the file path. If none of the directory exists,
it is default to 0755.
Previously we use base::CreateDirectoryAndGetError(), which always sets
the new directory permission to 0700, which is not what we want.
Fixes#499.
Change-Id: Iee9429d5e63ada9588f74ff20d3cce28a1a6437b
Previously packaging completes successfully without any error
or warning.
With the fix, an error will be reported if write fails. It may
appear as "Cannot close file error" as we use threaded IO, which
could delay the error reporting until Close() call, so the user
of the File API needs to make sure Close() returns successfully.
Also fixed a deadlock in threaded_io_file if internal_file->Write
fails.
Fixes#160
Change-Id: I17f945150fb4021d2dcdbe784e557673f53ca583