ssize_t qFileSave ( const char *  filepath,
const void *  buf,
size_t  size,
bool  append 
)

Save to file.

Parameters:
filepath file path
buf data
size the number of bytes to save
append false for new(if exists truncate), true for appending
Returns:
the number of bytes written if successful, otherwise returns -1.
   // save text
   char *text = "hello";
   qFileSave("/tmp/text.txt", (void*)text, strlen(text), false);

   // save binary
   int integer1 = 75;
   qFileSave("/tmp/integer.bin, (void*)&integer, sizeof(int));

Definition at line 400 of file qFile.c.


Generated on Mon Mar 26 07:00:51 2018 for JSOC_Documentation by  doxygen 1.5.7.1