Originally Posted By: Riamus2
NUL is actually used quite often both in mIRC and in other programs/scripts/etc. Just because you haven't seen it doesn't mean it's not used often. You likely just don't use/need the kind of scripts that would use it, so haven't seen it for that reason. Besides, both speed and efficiency are valid reasons for using/supporting something. Obviously, a switch that does the same would be better, but that doesn't mean that using NUL is wrong or bad.

Before throwing broad generalizations out about how it's useless and not good to do and so on, why not try using it with /filter on a very large text file and compare your results. You'll find that there can be a significant difference in speed on large files (i.e. not just a few milliseconds).


I use the file handle functions (/fopen, /fseek, $fread, etc; Not $read and /write which are INCREDIBLY slow) or large files. Unlike /filter, you don't have to wait for the file to process for it to finish. You can pause and resume, and give the user the choice of canceling the operation all together.

Quote:
Btw, just because you can name a file with a device's name doesn't mean that you should. So you should never need to try and output to a FILE called NUL.


I have no control what people name there files. Windows will not let you create a file with the name NUL. But it will still appear in the directory if the file exists. But when you read from it it returns EOF. And writing to it will write to the device.

Last edited by MeStinkBAD; 12/04/10 04:36 PM.

Beware of MeStinkBAD! He knows more than he actually does!