Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is there an alternative method to CreateFile() for checking whether USB is writeable?

Thank you.
Posted
Updated 15-Jun-10 0:54am
v2
Comments
MercyRaj 25-Jun-10 5:55am    
Even if we aren’t able to find an alternative API for CreateFile, our issue solved by using CreateDirectory instead of CreateFile to check whether USB is writable or not.

Thank You.

if try and catch logic is available in C++ maybe you can use that... just a wild guess hoping i could help. :-)
 
Share this answer
 
Comments
MercyRaj 15-Jun-10 2:27am    
Sorry.I didn't get you.
Chaegie 15-Jun-10 2:31am    
in .net there is an option called try and catch.. so any problem within code that was written inside the try statement.. .net will fire it in catch statement telling what seems to be the problem.
so in your case.. upon writing in the usb and during writing there is a problem it will fire in catch statement.. like onerror go to.. something like that..
MercyRaj 15-Jun-10 2:56am    
try catch bolcks are present in c++
My problem is not createfile getting failed.
But an alternate method for CreteFile API.


Actully I need to check whether the inserted USB media is writable.
Currently CreateFile API is used for that.
I need to find out an alternative to check this without using create file API.
Even if we aren’t able to find an alternative API for CreateFile, our issue solved by using CreateDirectory instead of CreateFile to check whether USB is writable or not.

Thank You.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900