topten Posted April 5, 2016 Posted April 5, 2016 I need to read a file (no matter exe or txt) as binary. Then I write out file as binary. How can I decode back the txt file as a normal text? $in = FileOpen (@Desktopdir & "\myfile.txt", 16) $dbdata = FileRead ($in) FileWrite (@Desktopdir & "\myfile2.txt", $dbdata)
Jury Posted April 5, 2016 Posted April 5, 2016 Something about @DesktopDir works for me using other directories.
JohnOne Posted April 5, 2016 Posted April 5, 2016 You need to open myfile2.txt for binary write. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
topten Posted April 6, 2016 Author Posted April 6, 2016 I think I should specify the situation: I read text file or binary file as binary (file1) , save it to disk with other name (file2). After that all the info from text file or exe file are stored on disk as binary. Later I read (file2) and I want to save it to say file3- as it was originally created- text as text exe as exe $path = @Desktopdir & "\myfile2.txt" $in2 = FileOpen ($path, $FO_READ + $FO_OVERWRITE+ $FO_BINARY) This way didnt work binarytostring also didnt help FileWrite ($in2, BinaryToString($dbdata))
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