[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to check if user entered the right drive

Posted on 2006-03-27
1
Medium Priority
?
191 Views
Last Modified: 2010-04-01

Hi Experts,

I have asked the question previously in
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21772126.html

However, I am looking for something simple to check if the drive is there and writable.  What I need to do is to copy few files to a user supplied floppy or USB or any mapped drives.  I need to check quickly if the drive is valid before trying to copy the files.

What is the better way to do this.
0
Comment
Question by:thanesh
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 800 total points
ID: 16303444
The easiest way would be to call 'GetDiskFreeSpace()' - if that reports 'no space', the drive is probably readonly. If the function failes, the drive isn't there.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question