Jump to content

Recommended Posts

Posted

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

 

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...