Floppys

This is a discussion on Floppys within the C++ Programming forums, part of the General Programming Boards category; I do see what you mean. However, I am trying to compare a string to another string stored in a ...

  1. #16
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    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.
    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.

    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.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #17
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,667
    Quote Originally Posted by dwks
    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.
    Users can be dumb though. If you don't inform them of the problem is then it might not get fixed.

    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.
    He isn't even using a "high-level" language.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using Floppy's and CD ROM's in Slackware Linux?
    By drdroid in forum Tech Board
    Replies: 5
    Last Post: 04-09-2003, 01:39 AM
  2. floppy drives...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 39
    Last Post: 11-16-2001, 05:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21