Opened 16 years ago
Last modified 16 years ago
#681 closed Bug
Document 64KB line limit for FileReadLine() — at Initial Version
Reported by: | PsaltyDS | Owned by: | |
---|---|---|---|
Milestone: | Component: | Documentation | |
Version: | 3.2.13.10 | Severity: | None |
Keywords: | Cc: |
Description
Based on this support topic: FileReadLine problem read a very big line http://www.autoitscript.com/forum/index.php?showtopic=84354
FileReadLine() uses a 64K buffer that will return a longer single line as multiple 64K lines. For example, 96K line will be read out as a 64K line, then a 32K line.
Jon indicates this is not a bug, so documentation should be updated reflect the limitation.
Demo: {{{
Global $sFile = "test.txt", $hFile, $n
Global $sLine = "012345467890"
FileDelete($sFile)
; Create large line
Do
$sLine &= $sLine
Until Stringlen($sLine) > 216
ConsoleWrite("Actual line length = " & StringLen($sLine) & @LF)
; Open file
$hFile = FileOpen($sFile, 2) ; Overwrite
For $n = 1 To 10
; Write 10 lines
FileWriteLine($hFile,$sLine)
Next
FileClose($hFile)
; Test with FileReadLine()
$n = 1
While 1
$sLine = FileReadLine($sFile, $n)
If @error Then ExitLoop
ConsoleWrite("Line " & $n & " length = " & StringLen($sLine) & @LF)
$n += 1
WEnd}}}