#include "fs_list.h" #include #include 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 ); }