Serilization and caching the table works!

This commit is contained in:
Nathan Braswell
2015-08-26 03:45:34 -04:00
parent b67d5e85fe
commit d72cbdcedb
16 changed files with 276 additions and 25 deletions

View File

@@ -75,6 +75,22 @@ fun print(toPrint: double) : void{
}
// Ok, just some DEAD simple file io for now
fun file_exists(path: string::string): bool {
var char_path = path.toCharArray()
defer delete(char_path)
var result = false
__if_comp__ __C__ {
simple_passthrough(char_path:result:) """
bool result = false;
FILE *fp = fopen(char_path, "r");
if (fp) {
result = true;
fclose(fp);
}
"""
}
return result
}
fun read_file(path: string::string): string::string {
var toRet.construct(read_file_binary(path)): string::string
return toRet