2022-08-29 15:41:40 +02:00
|
|
|
#include "../../../System Abstraction/cdb_sustem.h"
|
2022-08-28 13:47:31 +02:00
|
|
|
#include "stdio.h"
|
|
|
|
|
|
|
|
void main(){
|
|
|
|
sus_File file = sus_fileOpenInMem("testfile.txt", SUS_FILE_NOTHING);
|
|
|
|
if(file == NULL){
|
2022-08-29 17:27:24 +02:00
|
|
|
printf("file is null\n");
|
2022-08-28 13:47:31 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
char * memroy = sus_fileFileToMemroy(file);
|
|
|
|
if(memroy == 0){
|
|
|
|
printf("memroy was null\n");
|
|
|
|
return;
|
|
|
|
}else{
|
2022-08-29 17:27:24 +02:00
|
|
|
printf("Read chars: %c%c%c\n", memroy[0], memroy[1], memroy[2]);
|
2022-08-28 13:47:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sus_fileResize(file, 2);
|
|
|
|
memroy = sus_fileFileToMemroy(file);
|
|
|
|
memroy[0] = 'a';
|
|
|
|
memroy[1] = 'b';
|
|
|
|
memroy[2] = 'c';
|
|
|
|
memroy[3] = 'd';
|
|
|
|
memroy[4] = 'e';
|
|
|
|
sus_fileClose(file);
|
2022-08-29 17:27:24 +02:00
|
|
|
|
2022-08-28 13:47:31 +02:00
|
|
|
file = sus_fileOpenInMem("testfile.txt", SUS_FILE_NOTHING);
|
|
|
|
memroy = sus_fileFileToMemroy(file);
|
|
|
|
memroy[0] = 'O';
|
|
|
|
sus_fileClose(file);
|
|
|
|
}
|