From: nobu.nokada@... Date: 2004-11-18T00:39:49+09:00 Subject: Re: Detecting rubyw Hi, At Wed, 17 Nov 2004 23:57:52 +0900, Nathaniel Talbott wrote in [ruby-talk:120639]: > >> Is there any way (on Windows) to detect if a script is running under > >> rubyw.exe, i.e. headless? > > > > Can you open "CONIN$" and "CONOUT$" device files? > > I don't know... how would I do that? I don't think I've ever opened a > device file on Windows. Just open as well as ordinary files. begin open("CONIN$") {} open("CONOUT$", "w") {} have_console = true rescue SystemCallError have_console = false end -- Nobu Nakada