33 lines
859 B
C
33 lines
859 B
C
#include "../../../System Abstraction/cdb_sustem.h"
|
|
#include "stdio.h"
|
|
|
|
void main(){
|
|
sus_File file = sus_fileOpenInMem("testfile.txt", SUS_FILE_NEW);
|
|
if(file == NULL){
|
|
printf("file is null\n");
|
|
return;
|
|
}
|
|
|
|
char * memroy = sus_fileFileToMemroy(file);
|
|
if(memroy == 0){
|
|
printf("memroy was null\n");
|
|
return;
|
|
}else{
|
|
printf("%c\n", memroy[0] == 0 ? 'Y' : 'N');
|
|
}
|
|
|
|
sus_fileResize(file, 4);
|
|
memroy = sus_fileFileToMemroy(file);
|
|
memroy[0] = 'a';
|
|
memroy[1] = 'b';
|
|
memroy[2] = 'c';
|
|
memroy[3] = 'd';
|
|
memroy[4] = 'e';
|
|
sus_fileFlush(file);
|
|
sus_fileClose(file);
|
|
file = sus_fileOpenInMem("testfile.txt", SUS_FILE_NOTHING);
|
|
memroy = sus_fileFileToMemroy(file);
|
|
memroy[0] = 'O';
|
|
sus_fileFlush(file);
|
|
sus_fileClose(file);
|
|
} |