Currently some of the file polyfills use fread/fwrite. They currently ignore the return values and should be coded to repeat until the desired len is reached. This should include some checks for fread if eof or errors, and fwrite for errors, with a limited amount of retries.