Deleting files on Compact Flash Cards

S

Spanky deMonkey

I am running XP SP2 with all the MS updates. I have an internal card reader
USB 2.0 enhanced, and when I insert my 8GB card into the reader, I can copy
files to the HDD pretty quick.

When it's time to delete off the card, it takes forever. For instance I
deleted 127 files (JPEG) and it took 66 seconds. I tried to delete 394
(JPEG) files about 1.5GB and it took 4 minutes, 29 seconds.

Why so long? I thought when files are deleted, the FAT table is erased and
the files left alone.

Any help would be appreciated.

Thanks
 
A

Ace

You say your card reader supports USB2.0, but I am wondering about your
computer's motherboard.
How are the writing speeds?
Note that lots of small files take longer than one large file.
You may notice the same lack of speed when 'moving' files from flash to
disk or vice/versa.
'Move' is copy, then delete; a double action, taking almost double time.
You could try finding a firmware/driver update for your card reader on
the manufacturer's website, if they make these available.
On the FAT filesystem, files are not actually deleted. They are hidden,
by having the first character of the filename overwritten. :)
Thus the data is still there, but the reference in FAT is broken, and the
filesystem will not display them until you dig the files up with data
recovery software.
 
M

M.I.5¾

Spanky deMonkey said:
I am running XP SP2 with all the MS updates. I have an internal card
reader USB 2.0 enhanced, and when I insert my 8GB card into the reader, I
can copy files to the HDD pretty quick.

When it's time to delete off the card, it takes forever. For instance I
deleted 127 files (JPEG) and it took 66 seconds. I tried to delete 394
(JPEG) files about 1.5GB and it took 4 minutes, 29 seconds.

Why so long? I thought when files are deleted, the FAT table is erased
and the files left alone.

Whilst you are correct in your assumption, you have overlooked the way FLASH
memory actually works. As you are probably aware: every time you delete a
file, the file directory is updated to show that the file is now deleted and
the FAT tables (there are 2 - one is a duplicate of the other) are updated
to show that the sectors are now free (FLASH doesn't really use sectors as
such, but that is how the FAT filing system works - but FLASH memory is
organised into blocks).

The problem arises because it is not possible to alter one or two bits in
any block on FLASH memory. The only way that can be achieved is to read
the block into a buffer; alter the bits in the buffer; erase the whole block
and then write the buffer back to the block. In practice because the memory
has limited rewrite capability, the buffer is actually written to the least
recently used block (or the next unused block if the memory is fairly new).
The memory houskeeping controller keeps track of what is written where.
This whole process is handled entirely by the housekeeping circuitry on the
memory chips themselves and is entirely transparently to the Windows
operating system. This process occurs for each file that is deleted. The
FLASH controller was not equipped with a crystal ball and has no means of
knowing that the operating system is about to delete another file.

It should be noted that the architecture of FLASH memory cards from
different sources varies and this can affect how the operating system
interacts with it. The times you describe for deleting files from an 8Gb
memory card do not seem to be excessively long.

If you wish to erase the card completely, it is much quicker to format it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top