From: sam on
I am developing a program for photographers. One of the things the
program does is copy images from memory cards to the computer's hard
drive. Some photographers would like the program to "format" the card
after copying the files to the computer so they do NOT have to go in
and format the cards in the camera themselves.

After doing some research it appears there is a low level format and a
high level format, hard drives require a step in between. All of
which is more detail then I need. All I am looking to do is clear out
the, I believe it is called the FAT table.

The ultimate objective is that the user can stick the memory card back
in to the camera and keep shooting with a "clean" memory card.

It is actually MORE desirable to *NOT* destroy the images, just the
FAT table, in case they make a mistake and did not want to format the
memory card after all.

How might I achieve this?

Sam
From: Norman Bullen on
sam wrote:
> I am developing a program for photographers. One of the things the
> program does is copy images from memory cards to the computer's hard
> drive. Some photographers would like the program to "format" the card
> after copying the files to the computer so they do NOT have to go in
> and format the cards in the camera themselves.
>
> After doing some research it appears there is a low level format and a
> high level format, hard drives require a step in between. All of
> which is more detail then I need. All I am looking to do is clear out
> the, I believe it is called the FAT table.
>
> The ultimate objective is that the user can stick the memory card back
> in to the camera and keep shooting with a "clean" memory card.
>
> It is actually MORE desirable to *NOT* destroy the images, just the
> FAT table, in case they make a mistake and did not want to format the
> memory card after all.
>
> How might I achieve this?
>
> Sam
Simply delete all the images and remove all the directories. It amounts
to the same thing as a high-level format.

Note that deleting a file does not destroy the data. There are utilities
available which can un-delete files and directories.

--
Norm

To reply, change domain to an adult feline.

From: Christian ASTOR on
sam wrote:

> It is actually MORE desirable to *NOT* destroy the images, just the
> FAT table, in case they make a mistake and did not want to format the
> memory card after all.
>
> How might I achieve this?

As Norman said, just delete the files and/or directories
(SHFileOperation(), ...)
Otherwise, FormatEx() or FormatEx2() (FMIFS.DLL)
or IFormatEngine interface (Vista)