Having this issue while doing the IFU, files are read from SD card, ready to start the update but i need to remove the files from SD card so the system is not picking these up after reboot.
// Close the files
filestreamApp.Close();
filestreamFw.Close();
// Dispose the objects
filestreamApp.Dispose();
filestreamFw.Dispose();
// Delete the files
File.Delete(rootDirectory.Name + "mfc.tca");
File.Delete(rootDirectory.Name + "firmware.ghi");
//Thread.Sleep(30000);
// Wait until processed by the file system before starting the update
if (File.Exists(rootDirectory.Name + "mfc.tca"))
{
Debug.WriteLine("mfc.tca NOT deleted");
}
if (File.Exists(rootDirectory.Name + "firmware.ghi"))
{
Debug.WriteLine("firmware.ghi NOT deleted");
}
The File.Exist is returning false, but if i update and reboot the files are still on SD card.
If i put a break, wait for 60 seconds and then update and reboot the files are gone.
Question: How can i detect when the files are “Realy” deleted and not still in transition to be deleted?
Thx