|
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.
char *text = "hello";
qFileSave("/tmp/text.txt", (void*)text, strlen(text), false);
int integer1 = 75;
qFileSave("/tmp/integer.bin, (void*)&integer, sizeof(int));
Definition at line 400 of file qFile.c.
|