• Home

Direct Output To Dev Null C

 

Mac

Null

Direct Output To Dev Null Codes

P: n/a
On Apr 19, 2:13 am, Mark P <use..@fall2005REMOVE.fastmailCAPS.fm>
wrote:
Bryan wrote:
In unix if I want to dump some output into never never land I can do
something like:
std::ofstream outfile('/dev/null');
What is the equivalent in windows? /dev/null seems not to work properly.
Is it std::ofstream outfile('NUL')?
Not certain of this, but I would expect that you can simply default
construct an ofstream without specifying a file name.
Yes, but that will result in an error; typically, an output
error will cause the code to fail. (Output errors are normally
fairly serious, except for secondary output, like logging.)
It's pretty simple to define a nulstreambuf, which emulates the
behavior of '/dev/null' exactly. (EOF for all reads, success
for all writes.) Then just create an ostream with this as the
streambuf.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Redirect Stdout To Dev Null C

Hi i am running oracle database import through a script and script scans the import log to see if there are any errors. Now the porblem is that when i run the script the import log appears on the screen even if i direct the output of import to /dev/null. Imp '/ as sysdba'. Jun 05, 2014 What is a null (/dev/null) file in a Linux or Unix-like systems? /dev/null is nothing but a special file that discards all data written to it. The length of the null device is always zero. Little snitch free. In this example, first, send output of date command to the screen and later to the /dev/null i.e. Discards date command output.