mIRC Homepage
Posted By: trenzterra $fread bug - 11/09/03 04:49 AM
If you use $fread to read an empty invalid line on a file, eg file.txt, it will return an empty line TWICE instead of once.
Posted By: codemastr Re: $fread bug - 11/09/03 06:35 PM
Can you provide an example of what you mean?
Posted By: trenzterra Re: $fread bug - 12/09/03 01:31 AM
eg you have a file, named test.txt

inside it contains:

abc

blah


2 lines
no space

1 line


--------
If you use $fread, you get this result

abc
>invalid line
>invalid line
blah
>invalid line
>invalid line
>invalid line
>invalid line
2 lines
no space
>invalid line
>invalid line
1 line

------------
$fread supposed to show this:


abc
>invalid line
blah
>invalid line
>invalid line
2 lines
no space
>invalid line
1 line
Posted By: cold Re: $fread bug - 12/09/03 09:49 AM
It works here.
Code:
fopen x test.txt
while (1) {
  echo -a * $fread(x)
  if ($feof) break
}
fclose x
-
* fopen opened 'x' (C:\MIRC\MIRC 6.1\test.txt)
-
* abc
*
* blah
*
*
* 2 lines
* no space
*
* 1 line
-
* fclose closed 'x' (C:\MIRC\MIRC 6.1\test.txt)
-
© mIRC Discussion Forums