File making and reading scripts

Bloodbane

Well-known member
I've been studying file reading scripts, the result is good so far, I can find certain line and acquire value in that line from read file

However for file making scripts, seems like there's only this function:

filestreamappend(file, value, 0)

which can be repeated to insert values before saving it to a file with this function:

savefilestream(file, filename)

Previous function appends inserted value at end of lines of values
Well, I am expecting a function which can write value directly at defined line instead of that. Is there such function?
If not, I would have to use other method such as acquire all values and rewrite them or writing multiple files or combination of these
 
These are all openbor file functions:
Code:
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_openfilestream, "openfilestream");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_getfilestreamline, "getfilestreamline");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_getfilestreamargument, "getfilestreamargument");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_filestreamnextline, "filestreamnextline");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_getfilestreamposition, "getfilestreamposition");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_setfilestreamposition, "setfilestreamposition");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_filestreamappend, "filestreamappend");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_createfilestream, "createfilestream");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_closefilestream, "closefilestream");
    List_InsertAfter(&theFunctionList,
                     (void *)openbor_savefilestream, "savefilestream");

for filestreamappend you have 3 flags:
NULL(): append line normally
0: append line with a space
1: append line with a space and a "\n" (line return)

I wrote a function that reads whole bor.hi file (hi-score file) to make a custom hall-of-fame scene and I wrote a function to read a byte (with a little trick) and not only string,int,float as getfilestreamargument

Ps. Remember that when you open a file to write/read it, call closefilestream(savefile) in anycase at the end of your script;
 
Back
Top Bottom