16 lines
407 B
C
16 lines
407 B
C
#include <cosms-core/file.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
unsigned int buffer_size;
|
|
char *buffer;
|
|
CosmsFileError error = cosms_core_file_read("test.txt", &buffer, &buffer_size);
|
|
if (error != COSMS_FILE_OK) {
|
|
fprintf(stderr, "failed to read file exited with error code: %d\n", error);
|
|
return -1;
|
|
}
|
|
|
|
printf("File read with content:\n %s\n", buffer);
|
|
return 0;
|
|
}
|