No they're not the same, although generally you'll be fine to use $feof and $ferr, the difference is that these identifiers are global, whereas $fopen(name).err/.eof are local to this file only. Though in a script, these identifiers will always represent the values of the file accessed in the script.

Btw the problem isn't the while loop, I know it wouldn't error there, but the fclose would give an error if it wasn't open, therefore you must check $ferr right after /fopen.

In your new version it is better because you use $fopen(name) before closing, but it could still be improved a bit. Observe:

//fopen blabla lol | echo -a > $fopen(blabla) vs $ferr

Even though there was an error to open the file (* fopen unable to open 'blabla' (D:\mIRC\lol)) $fopen(name) returns the name. Note that you will however be able to close it just fine since mIRC actually initiated a "file" object, despite the fact it was unable to open the specific file, so for your script checking $fopen(name) like you do now is sufficient.


Gone.