Out of space error in iPhone
In iPhone, how do you determine if a file couldn't be written to the documents are开发者_如何学Goa because of an out of space error?
fwrite
returns the number of items written, so you can check if it's consistent to know if there's any errors:
if (fwrite(data, sizeof(Something), 1234, fp) != 1234) {
// handle error.
}
This is the only documented way to check if a fwrite
failure (including out-of-space error) happens.
精彩评论