Learn library SD card question
DavidZemon
Posts: 2,973
in Propeller 1
void run_test() {
sd_mount(0, 1, 2, 3);
FILE *reader = fopen("fat_test.txt", "r");
FILE *writer = fopen("new2.txt", "w");
while (!feof(reader))
fputc((char) fgetc(reader), writer);
fclose(reader);
fclose(writer);
}
The above code should copy a file to a new file.... pretty simple. Unfortunately, when I check the resulting file from my computer, there seems to be an extra byte at the end - 0xff if I understand what gedit is showing correctly. Am I doing anything incorrectly?

Comments
http://www.cplusplus.com/reference/cstdio/feof/
Looks like my loop should be