Guest Alexey Posted March 26, 2005 Share Posted March 26, 2005 How do i write a zero-character into a file? This writes nothing to a file FileWrite($f, Chr(0)) Link to comment Share on other sites More sharing options...
Insolence Posted March 26, 2005 Share Posted March 26, 2005 Do you mean like this? FileWrite($f, 0) "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Ejoc Posted March 26, 2005 Share Posted March 26, 2005 I thought I saw on the boards somewhere someone wrote some Binary File I/O functions Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
Guest Alexey Posted March 26, 2005 Share Posted March 26, 2005 (edited) to Insolence: Sorry for confusing title, i didn't mean a "0" character i mean a character with ASCII code equal to 0.Okay, im still searching, here's what i have found so far:AutoIt can't handle binary files (yet).<{POST_SNAPBACK}>You can write any ASCII character to a file using FileWrite($f, Chr($c)) where $c is from 1 to 255, but it doesn't do anything if $c = 0... Edited March 26, 2005 by Alexey Link to comment Share on other sites More sharing options...
Guest Alexey Posted March 26, 2005 Share Posted March 26, 2005 Okay, I have found a DLL to read/write a binary file here. Many thanks to LazyCat. Link to comment Share on other sites More sharing options...
layer Posted March 27, 2005 Share Posted March 27, 2005 this doesnt read or write binary files... but it can translate text into binary or binary into text, im not sure if thats what you need? Func Text2Binary($text) $letters= StringSplit("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",") $split= StringSplit("01100001,01100010,01100011,01100100,01100101,01100110,01100111,01101000,01101001,01101010,011010 11,01101100,01101101,01101110,01101111,01110000,01110001,01110010,01110011,01110100,01110101,0111011 0,01110111,01111000,01111001,01111010", ",") $out = $text For $i = 1 to $letters[0] $out= StringReplace($out, $letters[$i], $split[$i], 1) Next Return $out EndFunc $text2bin = Text2Binary("testing") MsgBox(0, "Text2Binary", $text2bin) Func Binary2Text($binary) $letters= StringSplit("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",") $split= StringSplit("01100001,01100010,01100011,01100100,01100101,01100110,01100111,01101000,01101001,01101010,011010 11,01101100,01101101,01101110,01101111,01110000,01110001,01110010,01110011,01110100,01110101,0111011 0,01110111,01111000,01111001,01111010", ",") $out = $binary For $i = 1 to $split[0] $out= StringReplace($out, $split[$i], $letters[$i], 1) Next Return $out EndFunc $bin2text = Binary2Text($text2bin) MsgBox (0, "Binary2Text", $bin2text) FootbaG Link to comment Share on other sites More sharing options...
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