1. ## Determine available drives

is there any way to determine if there is a disk inserted in a drive( or is it a port ) [sorry for my poor english terms] like in E: or F:, etc.
i tried doing
Code:
FILE *fp;
fp = fopen( "E:\\text.dbf", "w" );
if( fp = NULL );
to test if i can create a file in a disk inserted in E:

2. Code:
if( fp = NULL );
Well that's not going to do much good unless include a code block after the if statement, and you're assigning, not comparing.
= means assign.
== means compare.

3. Also, are you looking for that specific file, or just to see if there's any drive even there?

EDIT: Oh hey, you're opening in "w" mode. Right, so check with your OS manufacturer as Salem suggests.

4. Originally Posted by tabstop
Also, are you looking for that specific file, or just to see if there's any drive even there?
just to see if there's any drive.

@cpjust
oh sorry. it was a typo. i meant == not =

*EDIT:
so how do i know if there's any drive inserted?