Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 detecting drives in turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JayLo




PostPosted: Sat Jun 07, 2003 11:04 pm   Post subject: detecting drives in turing

is there a way to find out how many drives on a computer there are and their corresponding letters?
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Sat Jun 07, 2003 11:35 pm   Post subject: (No subject)

off the top of my head i know of no easy way of doing it, you may beable to use the dir comands to check to see if a driver existe by trying to open it then seeing if you get a good value...
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
void




PostPosted: Sun Jun 08, 2003 10:32 am   Post subject: (No subject)

basically just run all the letters from a to z as drives and keep a record in an array of what kind of value it returns...then do whatever you want now that u know which ones exist and which ones dont....
EDIT: Dan suggested the same thing...i just never bothered to read it when i posted this
Andy




PostPosted: Sun Jun 08, 2003 1:02 pm   Post subject: (No subject)

ya just have a for loop
for i:65..90
end for
and just use chr(i) as a drive and open files
Catalyst




PostPosted: Sun Jun 08, 2003 2:23 pm   Post subject: (No subject)

this detects drives
it wont detect the floppy or cd drives unless there is somthing in them
code:

var dirCheck : int


for i : 97 .. 122
    dirCheck := Dir.Open (chr (i) + ":\\")
    if dirCheck = 0 then
        put chr (i) + ":\\ does not exist"
    else
        put chr (i) + ":\\ does exist"
        Dir.Close (dirCheck)
    end if

end for
Andy




PostPosted: Sun Jun 08, 2003 4:25 pm   Post subject: (No subject)

damn, got shutdown by catalyst once again...
JayLo




PostPosted: Sun Jun 08, 2003 8:05 pm   Post subject: (No subject)

lol, he's so leet. he's catalyst. thanks a bunch, dude.
Andy




PostPosted: Sun Jun 08, 2003 8:12 pm   Post subject: (No subject)

ugh, sucking upers, go catalyst, damn, y is he so good, catalyst come to massey, we need smart ppl
JayLo




PostPosted: Mon Jun 09, 2003 9:50 pm   Post subject: (No subject)

gotta love sucking up! Razz
Andy




PostPosted: Tue Jun 10, 2003 5:38 pm   Post subject: (No subject)

ya but u should suck up to somewhere useful like to tony or dan or even the psycho mod
JayLo




PostPosted: Tue Jun 10, 2003 9:14 pm   Post subject: (No subject)

please, do explain "the psycho mod"? flame him up, yo. Razz
Andy




PostPosted: Wed Jun 11, 2003 3:35 pm   Post subject: (No subject)

no Asok, i said i was sorry AHHHHHHHHHHHHHHHHHHh
NOT THE FLAME THROWER!!!!!!!!!!!!!!!!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: