|
|
|
@ -101,113 +101,6 @@ int main() |
|
|
|
|
} |
|
|
|
|
while (fat16_next(&file)); |
|
|
|
|
|
|
|
|
|
fat16_root(&fat, &file); |
|
|
|
|
|
|
|
|
|
// if (fat16_find(&file, "FOLDER"))
|
|
|
|
|
// {
|
|
|
|
|
// if (fat16_opendir(&file))
|
|
|
|
|
// {
|
|
|
|
|
// printf("Listing FOLDER:\n");
|
|
|
|
|
|
|
|
|
|
// do
|
|
|
|
|
// {
|
|
|
|
|
// printf("File name: %s, %c, %d B, @ 0x%x\n",
|
|
|
|
|
// fat16_dispname(&file, str),
|
|
|
|
|
// file.type, file.size, file.clu_start);
|
|
|
|
|
// }
|
|
|
|
|
// while (fat16_next(&file));
|
|
|
|
|
|
|
|
|
|
// char m[49];
|
|
|
|
|
|
|
|
|
|
// if (fat16_find(&file, "banana.exe"))
|
|
|
|
|
// {
|
|
|
|
|
// fat16_fread(&file, m, 49);
|
|
|
|
|
// printf("%.49s\n", m);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// fat16_rmfile(&file);
|
|
|
|
|
|
|
|
|
|
// if (fat16_parent(&file)) {
|
|
|
|
|
// printf("Current file: %s\n", fat16_dispname(&file, m));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// printf("Found? %d\n", fat16_find(&file, "FOLDER2"));
|
|
|
|
|
// printf("Deleted? %d\n", fat16_rmdir(&file));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// printf("Found? %d\n", fat16_find(&file, "FOLDER2"));
|
|
|
|
|
// printf("Deleted? %d\n", fat16_rmdir(&file));
|
|
|
|
|
|
|
|
|
|
// if (fat16_mkfile(&file, "banana2.exe"))
|
|
|
|
|
// {
|
|
|
|
|
// fat16_fwrite(&file, "THIS IS A STRING STORED IN A FILE CALLED BANANA!\n", 49);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// fat16_find(&file, "banana.exe");
|
|
|
|
|
// char m[49];
|
|
|
|
|
// fat16_fread(&file, m, 49);
|
|
|
|
|
// printf("%.49s\n", m);
|
|
|
|
|
|
|
|
|
|
//fat16_mkdir(&file, "FOLDER2");
|
|
|
|
|
|
|
|
|
|
// bool found = fat16_find_file(&file, "NEW_FILE.DAT");
|
|
|
|
|
//
|
|
|
|
|
// if (found)
|
|
|
|
|
// {
|
|
|
|
|
// fat16_delete_file(&file);
|
|
|
|
|
// fat16_set_file_size(&file, 16000);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//printf("Exists? %d\n", fat16_find_file(&file, "nuclear.war"));
|
|
|
|
|
//printf("Size: %d\n", file.size);
|
|
|
|
|
|
|
|
|
|
//fat16_set_file_size(&file, 5);
|
|
|
|
|
|
|
|
|
|
//fat16_fseek(&file, 40000);
|
|
|
|
|
//fat16_fwrite(&file, "BANANA", 6);
|
|
|
|
|
|
|
|
|
|
// FAT16_FILE neu;
|
|
|
|
|
// bool ok = fat16_newfile(&file, &neu, "NEWFILE3.DAT");
|
|
|
|
|
// if (!ok) {
|
|
|
|
|
// printf("FAIL.");
|
|
|
|
|
// return -1;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// char c = '_';
|
|
|
|
|
// for (uint16_t i = 0; i < 35000; i++) {
|
|
|
|
|
// fat16_fwrite(&neu, &i, 2);
|
|
|
|
|
// fat16_fwrite(&neu, &c, 1);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//fat16_fwrite(&neu, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//char* text = "KUNDA";
|
|
|
|
|
//fat16_fseek(&file, 30000);
|
|
|
|
|
//fat16_fwrite(&file, text, strlen(text));
|
|
|
|
|
|
|
|
|
|
//fat16_fseek(&file, 30000);
|
|
|
|
|
|
|
|
|
|
//char boo[5];
|
|
|
|
|
//bool v = fat16_fread(&file, boo, 5);
|
|
|
|
|
|
|
|
|
|
// if (!v) {
|
|
|
|
|
// printf("FAIL!\n");
|
|
|
|
|
// return 1;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// printf("%.5s\n", boo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// char ham[20000];
|
|
|
|
|
//
|
|
|
|
|
// fat16_find_file(&file, "HAMLET.TXT");
|
|
|
|
|
// fat16_fread(&file, ham, 20000);
|
|
|
|
|
// ham[19999] = 0;
|
|
|
|
|
// printf("%s\n", ham);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_close(); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|