Binary file write
Hi, I would like to write a zip file to the SD card. The zip file is supposed to be downloaded via TinyGSM, then unzipped with unzipLIB. The following illustrates, what I would like to achieve: FOTA server --> TinyGSM downloads the ZIP (in this stage, it is in RAM) --> ??? --> unzipLIB decompresses it to SD card as a .bin file.
The ??? part would be my question. How can I write the zip file from RAM, to SD card? It should be a binary write. In C, I have to open file like this: fopen("firmware.bin","wb+"); and then write with fwrite() So what functions should I use in this library to achieve the same?
Files are opened for binary write by file.open(name, oflag) where oflag specifies a write mode .
file.write(buf. count) writes count bytes from buf.