parent
d6f28d6294
commit
efa672661b
@ -0,0 +1 @@
|
||||
.*
|
@ -0,0 +1,26 @@
|
||||
#include "fs_list.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int fs_list_get( const char* filename )
|
||||
{
|
||||
FILE* f;
|
||||
int pos = 0;
|
||||
f = fopen(filename,"r");
|
||||
fscanf( f, "%d", &pos );
|
||||
fclose(f);
|
||||
|
||||
return pos;
|
||||
}
|
||||
void fs_list_set( const char* path, int value )
|
||||
{
|
||||
char tmp_filename[512];
|
||||
snprintf( tmp_filename, 512, "%s.tmp", path );
|
||||
FILE* f = fopen(tmp_filename,"w");
|
||||
fprintf( f, "%d", value );
|
||||
fclose(f);
|
||||
rename( tmp_filename, path );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue