Ok - I am able to delete files but seems like I can not copy files on the T3.6. That issue needs to be addressed by @WMXZ - it sounds like a problem with lib but I don't know where.
void MTPStorage_SD::removeFile(uint32_t store, char *file)
{
char tname[MAX_FILENAME_LEN];
File f1=sd_open(store,file,0);
[B] if(f1.isDirectory())
{
[/B] File f2;
while(f2=f1.openNextFile())
{ sprintf(tname,"%s/%s",file,f2.name());
if(f2.isDirectory()) removeFile(store,tname); else sd_remove(store,tname);
}
sd_rmdir(store,file);
[B] }
else
{
sd_remove(store,file);
}
[/B]}
@WMXZ Looks like the same code that is in my current branch... Sort of sounded familiar, looking at my current branch which is now something like:I did some correction and updated https://github.com/WMXZ-EU/MTP_t4/
For @KurtE et al that have WIP forks, this is the new code
Code:void MTPStorage_SD::removeFile(uint32_t store, char *file) { char tname[MAX_FILENAME_LEN]; File f1=sd_open(store,file,0); [B] if(f1.isDirectory()) { [/B] File f2; while(f2=f1.openNextFile()) { sprintf(tname,"%s/%s",file,f2.name()); if(f2.isDirectory()) removeFile(store,tname); else sd_remove(store,tname); } sd_rmdir(store,file); [B] } else { sd_remove(store,file); } [/B]}
highlighted inserted lines. not sure why this was not detected before.
tested on T3.6 and T4.1