Computer Science Canada

Find a file?

Author:  paintball_guy [ Wed May 07, 2003 2:21 pm ]
Post subject:  Find a file?

Hey, I wanna make a program that finds a random file on your computer and then goes "POOF! I know everything about your computer mwuahahaahahah" anyway i can do the poof part but how do i get the program to just find a random file, because if i preset which file to find, then it may not always be there.... PLEH<< (thats help backwards Smile)

Author:  Homer_simpson [ Wed May 07, 2003 3:44 pm ]
Post subject: 

this code might help u
code:
var streamNumber : int
var fileName : string

streamNumber := Dir.Open ("c:/")
assert streamNumber > 0
loop
    fileName := Dir.Get (streamNumber)
    exit when fileName = ""
    put fileName
end loop
Dir.Close (streamNumber)

Author:  paintball_guy [ Wed May 07, 2003 8:34 pm ]
Post subject:  Thx for script

tx for script but it says "Assert condition is false" Sad

Author:  Homer_simpson [ Wed May 07, 2003 9:23 pm ]
Post subject: 

well simply replace that with
code:
if streamNumber > 0  then put "directory not available"
end if


: