Hi again,

On Tue, Feb 10, 2015 at 7:34 PM, Rugxulo <rugx...@gmail.com> wrote:
> On Sun, Feb 8, 2015 at 1:13 PM, Frantisek Hanzlik <fra...@hanzlici.cz> wrote:
>>
>> I'm trying to write a small program that will distinguish whether
>> running under dosemu/FreeDOS or not, and accordingly do other things.
>
> I'm not under Linux right now, so I can't double check, but just FYI,
> here's (roughly) how I'd do it:

My bad, not testing usually means it doesn't work.

Here's a correct version (even if this is probably uglier / kludgier
than you wanted):

===========================
@echo off
if "%_CWD%"=="" goto end
REM ... "set /e" requires FreeCOM 0.84 ...
ver | find /i "0.84" >NUL
if errorlevel 1 goto end
:okay
ctty nul
set /e BLAH=unix uname
ctty con
if "%BLAH%"=="unix uname" goto realdos
:dosemu
echo ... running DOSEMU ...
goto end
:realdos
echo ... running native FreeDOS ...
:end
set BLAH=
===========================

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to