Phil Viton Posted May 18, 2008 Posted May 18, 2008 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.
Kip Posted May 18, 2008 Posted May 18, 2008 FileOpen(File,1+16) MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
monoceres Posted May 18, 2008 Posted May 18, 2008 (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 May 18, 2008 by monoceres Broken link? PM me and I'll send you the file!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now