Show progress of file copying

This commit is contained in:
RocketRobz 2018-10-11 14:55:09 -06:00
parent 3b06f2fc93
commit f7c4e77d84

View File

@ -60,6 +60,9 @@ int fcopy(const char *sourcePath, const char *destinationPath)
return -1;
break;
}
printf ("\x1b[16;0H");
printf ("Progress:\n");
printf ("%i/%i Bytes", (int)offset, (int)fsize);
// Copy file to destination path
numr = fread(copyBuf, 2, copyBufSize, sourceFile);
@ -69,6 +72,11 @@ int fcopy(const char *sourcePath, const char *destinationPath)
if (offset > fsize) {
fclose(sourceFile);
fclose(destinationFile);
printf ("\x1b[17;0H");
printf ("%i/%i Bytes", (int)fsize, (int)fsize);
for (int i = 0; i < 60; i++) swiWaitForVBlank();
return 1;
break;
}