LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

creating a file in a removable disk in runtime

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?

0 Kudos
Message 1 of 4
(2,976 Views)

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!

0 Kudos
Message 2 of 4
(2,958 Views)

i wanted make sure before i create the file on the volume. is it possible to verify before we create the file.

0 Kudos
Message 3 of 4
(2,947 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(2,941 Views)