aboutsummaryrefslogtreecommitdiff
path: root/src/lib/file.c
blob: b6ec1d0fc4f0abef0ccdbd6f4147d454d990008d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <lib/file.h>
#include <stdio.h>

// Write array to a file
bool_t write_array(char* output_file_name, void* array, size_t size)
{
  FILE *file = fopen(output_file_name, "wb");
  if (file == NULL) {
    fprintf(stderr, "Error opening file %s\n", output_file_name);
    return FALSE;
  }
  fwrite(array, size, 1, file);
  fclose(file);
  return TRUE;
}