You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a future defrag MYFILE.D81 command, behind the scenes, I'd just be doing a get, delete and put behind the scenes.
For the case of trying to put MYFILE.D81 where it already exists on the sd-card in a fragmented state, I've added a function into mega65_ftp.c called is_fragmented(filename) to check if an existing file is fragmented. So the logic here could be:
On upload_file()
{
If file exists on sd-card then
{
If `is_fragmented(filename)` then
delete existing file
}
copy across the new file
}
The text was updated successfully, but these errors were encountered:
is_fragmented can still be optimized a bit (no need to go through the whole file, if it finds the first non-consecutive cluster, it can return fragmentation directly). And it needs to be used, which is not done yet.
So this is no defrag command, but it will not reuse an existing files clusters if it was fragmented, and instead delete it, so that it is recreated in one continues clusterchain.
A little Discord discussion on this recently:
My thoughts for it are:
For a future defrag MYFILE.D81 command, behind the scenes, I'd just be doing a get, delete and put behind the scenes.
For the case of trying to put MYFILE.D81 where it already exists on the sd-card in a fragmented state, I've added a function into mega65_ftp.c called is_fragmented(filename) to check if an existing file is fragmented. So the logic here could be:
The text was updated successfully, but these errors were encountered: