in reply to Win32::EventLog's clear method without filename.
The name nul, will not appear in any directory listing as this file cannot exist. You can however open a filehandle to nul to "create it", write to it and close it. It will all look like a normal file operation except at the end of the day, a file called nul is never actually created. On Windows, case doesn't matter, NUL and nul are the same. The path doesn't matter. You can write to nul in any directory.
There are all sorts of handy uses for nul. Another example:C:\Projects>type temp.txt #types temp.txt to stdout C:\Projects>type temp.txt >nul #no output! types temp.text into cyber +space
exectues someprog.pl and the normal stdout output is thrown away. But anything written to stderr, like a warning or whatever will appear on the terminal.C:\someprog.pl 2>nul
In Unix, this concept is implemented via the device called null. /dev/null. Please note the spelling, and the number of letter l's! That is of course important!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::EventLog's clear method without filename.
by dannyd (Sexton) on Dec 24, 2010 at 08:30 UTC | |
by Marshall (Canon) on Dec 24, 2010 at 12:14 UTC |