@@ -73,25 +73,30 @@ int main(int argc, char **argv)
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const char *foo_filename[] = { "foo.bar", NULL };
 | 
			
		||||
    const char *baz_filename[] = { "baz.qux", NULL };
 | 
			
		||||
 | 
			
		||||
    memset_str(tmp_bfr, "baz.qux\x0a", 16384);
 | 
			
		||||
    fat12_write_file(part, "baz.qux", tmp_bfr, 16384);
 | 
			
		||||
    fat12_write_file(part, baz_filename, tmp_bfr, 16384);
 | 
			
		||||
    // run_command("yes baz.qux | dd bs=16384 count=1 | fattool build/fat12-fragmented.img writefile baz.qux");
 | 
			
		||||
 | 
			
		||||
    memset_str(tmp_bfr, "foo.bar\x0a", 16384);
 | 
			
		||||
    fat12_write_file(part, "foo.bar", tmp_bfr, 16384);
 | 
			
		||||
    fat12_write_file(part, foo_filename, tmp_bfr, 16384);
 | 
			
		||||
    // run_command("yes foo.bar | dd bs=16384 count=1 | fattool build/fat12-fragmented.img writefile foo.bar");
 | 
			
		||||
 | 
			
		||||
    fat12_delete_file(part, "baz.qux");
 | 
			
		||||
    fat12_delete_file(part, baz_filename);
 | 
			
		||||
    // fat12_flush(part);
 | 
			
		||||
    // run_command("fattool build/fat12-fragmented.img deletefile baz.qux");
 | 
			
		||||
    // fat12_sync(part);
 | 
			
		||||
 | 
			
		||||
    memset_str(tmp_bfr, "baz.qux\x0a", 32768);
 | 
			
		||||
    fat12_write_file(part, "baz.qux", tmp_bfr, 32768);
 | 
			
		||||
    fat12_write_file(part, baz_filename, tmp_bfr, 32768);
 | 
			
		||||
    // run_command("yes baz.qux | dd bs=16384 count=2 | fattool build/fat12-fragmented.img writefile baz.qux");
 | 
			
		||||
 | 
			
		||||
    fat12_ls_foreach(part, 0, NULL, list_directory);
 | 
			
		||||
 | 
			
		||||
    fat12_defragment_file(part, baz_filename);//const char *path[])
 | 
			
		||||
 | 
			
		||||
    fat12_close(part);
 | 
			
		||||
    fat12_free(&part);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user