Jump to content

Recommended Posts

Posted

Is it possible to read a binary file ? I can see that FileRead is for text files, but _FileReadtoArray seems to have no such limitation. I used _FileReadToAarray to open a pdf file, and then _FileWriteFromArray to write the entire thing back to disk under another name; but when I looked at the file, only the first 7 (or so) records of the file got written: the sizes were: original file 97K ; copy: 129 bytes.

Posted (edited)

FileRead is also for binary files, but you need to open the file first with FileOpen, example:

$in=FileOpen("input.exe",16) ; 16+0=Read binary
$out=FileOpen("output.exe",17) ; 1+16=Write binary
$data=FileRead($in)
FileWrite($out,$data)

:(

Edit: Kip the ninja :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...