C
C
Che_Bu_Rashka2016-06-20 09:44:10
Delphi
Che_Bu_Rashka, 2016-06-20 09:44:10

Why do flash drives burn when copying?

There is a code, the usual one, copies files to a USB flash drive in a cycle. Flash drives ~ 80 pieces. When launched, some "burned out". Everyone is "plugged up" in different ways. Some are irretrievably lost.
The code is a regular loop, with CopyFile without a pause:

for TFilesArrayItem in TFilesArray do begin
...
        if not (CopyFile(PWideChar(fromDisk + '\' + TFilesArrayItem.Value.FPlayList), PWideChar(dirName + TFilesArrayItem.key), false)) then begin
...
end;

inserted a pause sleep (700) and it seems that they stopped spoiling. (I myself do not have access to flash drives)
Question. can a flash drive fail very quickly when copying quickly? Why does a pause help? I thought maybe there is some kind of controller on it, which "chokes" and cannot cope with the high speed of copying. Is it so? Moreover, TotalCommander copies too quickly and nothing like it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-06-20
@alsopub

A very strange situation.
I can only speculate on this.
You write data and immediately remove flash drives without the "eject usb media" procedure.
That is, the data is written to the OS buffer and you remove the flash drives before the OS actually writes them to slow flash drives.

V
Vladimir Kuts, 2016-06-20
@fox_12

What flash drives are used? Maybe just a defective batch?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question