Why not just try to open the file? If you fail, then a disk wasn't inserted, the file is write-protected, you have insufficent permissions, or whatever. Your program shouldn't care why the file couldn't be opened. It just didn't work.I do see what you mean. However, I am trying to compare a string to another string stored in a text file on a floppy. If I let windows tell the user to insert a floppy, then the user could simply press continue, and the string would not be read, causing the variable I was gonna store it in to equal 0. I can't think of any other way to stop windows interfereing (interfereing ?) than to have the program to check for a disk instead.
Then your program isn't tied to working only with floppy disks, which, as mentioned, not everyone uses any more. (One of my computers doesn't even have a floppy drive.) You can open a file that's on a floppy disk, a CD-ROM, or even a terminal. That's what high-level languages are for: abstraction.