mIRC Home    About    Download    Register    News    Help

Print Thread
#48605 11/09/03 04:49 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
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.


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#48606 11/09/03 06:35 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Can you provide an example of what you mean?

#48607 12/09/03 01:31 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
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


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#48608 12/09/03 09:49 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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)
-


* cold edits his posts 24/7

Link Copied to Clipboard