Page 1 of 1

Drive / Volume read Question

Posted: Fri Feb 15, 2008 1:43 pm
by andyh1234
Ive got an old app written in VB on a PC that scans a drive (or memory card etc - basically any mounted volume) byte by byte, so I can put in a string and the app just looks for it.

Its a neat way to find a file i've deleted in the past, once found I just grab x bytes either side and dump them in a file which I can look at later.

Is there any way to do a byte by byte read of a volume in Revolution as I would love to rewrite it in Rev so I could use it on a mac and expand it, just not sure what the syntax would be to open a volume, get its size and then read it in.

Thanks!

Andy

Posted: Fri Feb 15, 2008 5:34 pm
by BvG
Runrev itself does not allow byte level access to the filesystem, you'd need an external or a shell command which allows that to do it.

If you just want to get filenames and/or file contents, read these entries in the documentation:

DefaultFolder
Files
Folders
answer file
answer folder
Open File
Read from File
Close File
URL
put

for reading a whole file at once, it's often simpler to use URL, instead of open/read/close file:

Code: Select all

on mouseUp
  answer file "Any file will do"
  if it = "" or the result <> "" then --user canceled
    exit mouseUp
  end if
  put url ("binfile:" & it) into theBinaryData
  --do stuff here with the Data you got now
end mouseUp

Posted: Sat Feb 16, 2008 12:28 pm
by andyh1234
Thanks, Ill go and see if I can work out an external command as its files that have been deleted that I want to scan the drive for, maybe just re-write the interface in rev.

Andy