Terenz Posted September 14, 2019 Posted September 14, 2019 Hello, I need to Read a file content like in this way: $hFile = FileOpen($sFilePath) $sTest = FileRead($hFile) FileClose($hFile) But i need to have a progress bar since i want to know the status of the "read", the file is bigger and require some times. Maybe i can read byte by byte: Local $sTest While 1 $sTest = FileRead($hFile, 1) If @error = -1 Then ExitLoop $sTest &= $sTest WEnd But first i dunno if is the best way, second i have a problem with the logic of the progress bar Some help? Thanks :D Nothing is so strong as gentleness. Nothing is so gentle as real strength
Jfish Posted September 14, 2019 Posted September 14, 2019 Have a look at this post. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
Terenz Posted September 14, 2019 Author Posted September 14, 2019 Isn't a text file, FileCountLine return 1 Nothing is so strong as gentleness. Nothing is so gentle as real strength
Jfish Posted September 14, 2019 Posted September 14, 2019 (edited) EDIT: works on PDFs and JPGS for me which are binary files ... what type of file are you working with? Edited September 14, 2019 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
TheDcoder Posted September 14, 2019 Posted September 14, 2019 If the file that you want to read is in binary, make sure you use the $FO_BINARY flag in FileOpen. Also, reading byte by byte is not really efficient... I recommend reading in reasonably large chucks (maybe 4 kilobytes) which would still be small compared to the whole file. EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
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