10-31-2012 09:31 AM
Hi,
I want ti create a binary file in a removable flash card in run time. I am using win xp. this removable drive in in IDE channel as a master. there is no user interaction with the application.therefore how do i make sure the i am creating the file in the correct volume?
11-01-2012 10:44 AM
Hey suni,
Presumably, your removable flash card always shows up in Windows with the same drive letter. When you call the OpenFile function to create the file, you provide it with a file path as the first argument. So you simply need to set the file path in that function to point to the removable flash card. This should create a file on the flash card.
If there's something happening that is keeping that ideal from working properly, please let us know. We're happy to assist you further!
11-02-2012 11:46 AM
i wanted make sure before i create the file on the volume. is it possible to verify before we create the file.
11-02-2012 01:00 PM - edited 11-02-2012 01:07 PM
You should be able to detect if a given drive is removable by using Win32 API function GetDriveType (): you'll need to #include windows.h to your code.
On my systems it correcftly detects a USB stick.
Among Volume Management Functions there are several functions that may come in handy when you need to perform non-trivial functions on disks.