Cross-platform way to find the null device?

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmrpnJyL5ZUqJRpUzxk1thkTLH=1qeP8BZXdAwOmrK-c0A@mail.gmail.com>
I want to redirect stderr to /dev/null on Unix, or nul on Windows. Is
there a simple way to find out the name of this machine's null device?
Python has "os.devnull" [1] but in Pike, what I'm looking at is a #if
__NT__ block. Is there a better way?

ChrisA

[1] https://docs.python.org/3/library/os.html#os.devnull
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.