n4th4nr1ch Posted March 28, 2011 Share Posted March 28, 2011 Hi, Trying to read a file. It's a binary config file. When I use DOS's 'type' command I see characters. Really what I want to do is something like the command 'strings' in UNIX: show the strings in a binary. However I will settle for just the whole output of the file. The problem is that due to the binary status of the file (I'm guessing), I can only seem to get the first character of the file. I've tried several things, for example this: $test = FileRead('c:\test.file') msgbox(0,'title', $test) That just shows me the first character of the file. I've tried messing around with BinarytoString as well. Help! =] Link to comment Share on other sites More sharing options...
n4th4nr1ch Posted March 28, 2011 Author Share Posted March 28, 2011 $in=FileOpen("C:\ifOutput.txt",16) $out=FileOpen("C:\ifOutput2.txt",2) $data=FileRead($in) FileWrite($out,$data) MsgBox(0,"","binary"&IsBinary($data)) MsgBox(0,"",binarytostring($data)) msgbox(0,"","here") If I run this code, only one message box ever opens. I think there is a bug in the binarytostring function (?) Link to comment Share on other sites More sharing options...
Developers Jos Posted March 28, 2011 Developers Share Posted March 28, 2011 How did you arrive to that conclusion? What are you trying to do exactly? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
n4th4nr1ch Posted March 28, 2011 Author Share Posted March 28, 2011 I'm trying to get the 'text' from a binary, without all the 'other' characters which seem to screw up autoit. The way I arrived at that conclusion is that if I try to convert to string, the script just hangs forever and I need to force kill it. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 28, 2011 Developers Share Posted March 28, 2011 I'm trying to get the 'text' from a binary, without all the 'other' characters which seem to screw up autoit.The way I arrived at that conclusion is that if I try to convert to string, the script just hangs forever and I need to force kill it.You are reading the whole file in one time into a binary field and then you convert the whole thing back to a string.Is that what you want to do or maybe something else? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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