Fastfs testing

This commit is contained in:
Such Meme, Many Skill
2020-05-19 17:54:21 +02:00
parent a8e86c2de3
commit b91c36d3fa
6 changed files with 249 additions and 23 deletions

View File

@@ -15,9 +15,8 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
FIL in, out;
FILINFO in_info;
u64 sizeRemaining, toCopy;
UINT temp1, temp2;
u8 *buff, toPrint = options & COPY_MODE_PRINT, toCancel = options & COPY_MODE_CANCEL;
u32 x, y, i = 11;
u32 x, y, i = 11, toSpeed;
int res;
gfx_con_getpos(&x, &y);
@@ -53,22 +52,20 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
sizeRemaining = f_size(&in);
const u64 totalsize = sizeRemaining;
DWORD *clmt_in = f_expand_cltbl(&in, BUFSIZE / 4, 0);
DWORD *clmt_out = f_expand_cltbl(&out, BUFSIZE / 4, totalsize);
while (sizeRemaining > 0){
toCopy = MIN(sizeRemaining, BUFSIZE);
if ((res = f_read(&in, buff, toCopy, &temp1))){
if ((res = f_read_fast(&in, buff, toCopy))){
gfx_errDisplay("copy", res, 5);
return 1;
break;
}
if ((res = f_write(&out, buff, toCopy, &temp2))){
if ((res = f_write_fast(&out, buff, toCopy))){
gfx_errDisplay("copy", res, 6);
return 1;
}
if (temp1 != temp2){
gfx_errDisplay("copy", ERR_DISK_WRITE_FAILED, 7);
return 1;
break;
}
sizeRemaining -= toCopy;
@@ -100,13 +97,10 @@ int fsact_copy(const char *locin, const char *locout, u8 options){
f_close(&out);
free(buff);
if ((res = f_chmod(locout, in_info.fattrib, 0x3A))){
gfx_errDisplay("copy", res, 8);
return 1;
}
f_chmod(locout, in_info.fattrib, 0x3A);
f_stat(locin, &in_info); //somehow stops fatfs from being weird
return 0;
return res;
}
int fsact_del_recursive(char *path){