﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
149	FileRead does not return EOF but does return @Error =0, an undocumented state	oblique		"{{{
;FileRead(filehandle or ""filename"" [, count])
;Failure(s): 
;EOF is not set when using 'filename' (default is to read entire file which I would expect to set EOF
;function returns @error = 0 which is an undocumented value
;########
;Code below will demonstrate the problem, and can be used to test that the problem has been fixed.
;any text file can be used to demonstrate the problem
;########
;prove FileOpen is good, and EOF is found
$file = FileOpen(""anytext.txt"", 0)
If $file = -1 Then
	MsgBox(0, ""Error"", ""Unable to open file."")
	Exit
EndIf
While 1
	$chars = FileRead($file, 10000)
	If @error = -1 Then ExitLoop
	MsgBox(0, ""Char read and EOF set:"", $chars)
Wend
FileClose($file)

;show error
$fileR = FileRead(""anytext.txt"")
MsgBox(0,""Entire file is read"", ""Chars:""&@CRLF&$fileR)
Select
	Case @error = -1
		MsgBox(0,"""",""pass; SPECIAL: @Error=""&@error&"" -1 = EOF is reached"")
	Case @error = 1
		MsgBox(0,"""",""FAIL; SPECIAL: @Error=""&@error&"" 1 = file not opened in read mode or other error, NOT POSSIBLE IN THIS TEST"")
	Case @error = 2
		MsgBox(0,"""", ""FAIL; SPECIAL: @Error=""&@error&"" 2 = count not defined for file open in raw read mode, NOT POSSIBLE IN THIS TEST"")
	Case Else
		MsgBox(0,"""",""FAIL; SPECIAL: @Error=""&@error&"" UNEXPECTED - @Error is set to 0 not -1 when FileRead is executed (default is entire file)"")
EndSelect

Exit}}}"	Bug	closed		AutoIt	3.2.10.0		No Bug	FileRead error	
