# >
[email protected] wrote:
# ># Assume stdout is closed and if i now
# ># want to open stdout, how to open it?
# >#
# ># IS this correct way of opening stdout
# >#
# ># fopen(stdout,"/dev/null");
-----------
# >
# >Don't. Use
# > freopen("/dev/null","w",stdout)
-----------
# >instead.
#
# 1. I know of several systems that don't know anything about /dev/null.
---------
Apparently it meant something to the original poster.
If he had used "[15,4]:kumquat.rfd", I would've copied
"[15,4]:kumquat.rfd" whether I use RMS or not.
# 2. On the ones that do, writing to /dev/null is usually not the same
# as writing to whatever-stdout-happened-to-point-to on program
# startup.
The original poster didn't want to write to whatever-stdout-happened-to-point-to.
# 3. Calling freopen with a third parameter that does not currently
# point to a stream invokes undefined behaviour (AFAIK).
Hence the whole "Don't [fclose stdout and fopen again]."
"I hate when you mortals need all the details spelled out."