﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3279	FileReadToArray() documentation missing important detail	rumbata@…		"When using FileReadToArray() with a file handle, the file position may need to be set to the beginning of the file (depending the mode used when opening the file). Otherwise, the function may produce unexpected results. While this behaviour does make sense, it is not quite obvious and needs to be clearly documented or changed.


{{{
; Incorrect result
$filehandle = FileOpen(""C:\temp\sample file.txt"", $FO_APPEND+$FO_CREATEPATH) ; The sample file is not empty
FileReadToArray($filehandle)
MsgBox(0, 'Unexpected Error', '@error is ' & @error & "", but this is not expected as the file is not empty!"")
; Presuming no other errors happened, @error will be set to 2 as if the file was empty

; Correct result
$filehandle = FileOpen(""C:\temp\sample file.txt"", $FO_APPEND+$FO_CREATEPATH) ; The sample file is not empty
FileSetPos($filehandle,0, 0)
FileReadToArray($filehandle)
MsgBox(0, 'Expected Result', '@error is ' & @error & "" and this is expected because the file is not empty."")
; Presuming no other errors happened, @error will be set to 0 because the file is not empty
}}}
"	Bug	closed		Documentation	3.3.14.2	None	No Bug		
