Exception when trying to copy a file

I am getting an error when I try to copy a file from SD card to a USB flash disk.


 #### Exception System.IO.IOException - CLR_E_FILE_IO (3) ####
 #### Message: 
 #### Microsoft.SPOT.IO.NativeFileStream::SetLength [IP: 0000] ####
 #### System.IO.FileStream::SetLength [IP: 0022] ####
 #### System.IO.File::Copy [IP: 0007] ####

When I remove the FLASH disk and check the file on the disk, the length is ZERO bytes. The size of the file on the SD is 4MB.

The files are all just plain text files.

@ Dave McLaughlin - Can you try to format the drives?

They are already formatted.

The programme currently reads and writes files to them without any issues. It just seems to be the copy that fails.

@ Dave McLaughlin - I mean format again, sometimes the file system can get corrupted and can cause weird or unlikely failures.

Can’t do that on the external flash drive as this would come from the customer and I don’t want to wipe his existing data.

I’ll find an empty flash disk and try that and see if it works after formatting.