Thread: removeable media

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    removeable media

    hey, is there a way to tell if my program is being removed from removeable media?
    also - is there a way to find if removeable media is connected to the pc my program is being run from?

    thanks :]
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > is there a way to tell if my program is being removed from removeable media?
    Generally, no.

    > is there a way to find if removeable media is connected to the pc my program is being run from?
    Depends on your OS.

  3. #3
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    :: Depends on your OS.

    Windows XP
    Registered Linux User #380033. Be counted: http://counter.li.org

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    > is there a way to find if removeable media is connected to the pc my program is being run from?

    Should be obvious -- if the program is being run from a floppy in a: drive then the disk has to be there, otherwise you couldn't run the program. How to tell if someone removes the disk after starting the program? depends on the program. If it attempts to read something from the disk then it won't work.

  5. #5
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    You can get the type of a drive in Windows with the GetDriveType() function. Passing NULL to it gives the type of the drive of the current directory.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Speculative media
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-17-2008, 10:06 PM
  2. uninstalling windows media player 10
    By MisterSako in forum Tech Board
    Replies: 0
    Last Post: 05-27-2006, 11:53 AM
  3. Windows Media is not working!!!
    By hdragon in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-18-2005, 05:42 AM
  4. media player problem
    By gooddevil in forum Tech Board
    Replies: 0
    Last Post: 05-19-2004, 01:43 PM
  5. Codec Bitrates?
    By gvector1 in forum C# Programming
    Replies: 2
    Last Post: 06-16-2003, 08:39 AM