How does $feof work? - 05/01/11 11:02 PM
Hello,
There are not very many information about $feof identifier in the manual. I know it returns the results of the last file access attempt in any script and it indicates the end of file was reached. However, how do I know which file was the last accessed?
Basically I have simple if-then-else statement:
If ($feof = 1) { CMDs }
But it seems like it never reaches the end of file ($feof is always 0). Is there any way how to find out what file is the last one accessed?
--------------------------------------------------------------
FYI this is my script with explanation:
Am I missing something here?
There are not very many information about $feof identifier in the manual. I know it returns the results of the last file access attempt in any script and it indicates the end of file was reached. However, how do I know which file was the last accessed?
Basically I have simple if-then-else statement:
If ($feof = 1) { CMDs }
But it seems like it never reaches the end of file ($feof is always 0). Is there any way how to find out what file is the last one accessed?
--------------------------------------------------------------
FYI this is my script with explanation:
Code:
Var %line=1 /* global variable */ On *:TEXT:*:#chan: { If ( ($nick == nick) && ($network == network) && (0NEW = $1) ) { If (!$window(@NEW)) { window -k0 @NEW } aline -ph @NEW $strip($4) savebuf -a 1 @NEW queue.dat /* saving each line from NEW window to file, faster then fopen-fwrite-fclose */ } If ( $timer(timerNEW) = $null ) { timerNEW 0 120 /Start } /* checking if timer is not already running, otherwise downloading every two minutes new input from the file */ } Alias Start { msg BOT xdcc send $read(queue.dat, %line) /* sending bot pack number, each is on the each line */ If ($feof = 1) { /* if the end of file was reached */ %line=1 /* start from the beginning next time */ fOpen -o Queue queue.dat /* clearing/emptying the file */ fClose Queue timerNEW off /* turning off the timer */ } else inc %line 1 /* else check next line */ }
Am I missing something here?