Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/dev/null is to unix as nul is to msdos

Status
Not open for further replies.

2016nc

Programmer
Jun 3, 2002
31
US
/dev/null is to unix as nul is to msdos. just in case for some reason you need to port some happy unix code to msdos and needed to know. I came across this while looking for a way to get rid of the default message when calling pause from msdos.

system("pause > nul");//MSDOS
 
Sometimes code like that should be recoded. Instead of using system, why not just use

getch ();

That will also wait until you hit carriage return, especially on Unix. Alternatively, you could use the ioctl stuff.

However, as you said, if someone is just looking for a byte bucket, just pipe it into /dev/null.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top