#include "../../../File-Page Abstraction/cdb_file-page.h" #include int main() { fp_File file = fp_fileNew("created", 512); if(file == NULL) { printf("file is null\n"); return 1; } char * memory = fp_fileToMemory(file); memory[0] = 'a'; memory[511] = 'b'; printf("Append pages\n"); memory = fp_fileAppendPages(file, 1); if(memory == NULL) { printf("memory is null\n"); return 1; } memory[1023] = 'z'; printf("Close\n"); fp_fileClose(file); printf("Open\n"); file = fp_fileOpen("created"); if(file == NULL) { printf("second file is null\n"); return 1; } printf("Init\n"); fp_fileInit(file, 512); memory = fp_fileToMemory(file); printf("%c%c%c\n", memory[0],memory[511],memory[1023]); fp_fileClose(file); return 0; }