Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

C's system() & COMMAND.COM (Developers)

posted by alexfru(R), USA, 13.09.2014, 17:06

> > > That's Unix(POSIX), not C. What are you doing, implementing a C
> > > compiler or an Unix-on-Dos emulation (as a cygwin for dos)?
> >
> > Not really.
> >
> > I want POSIX-ish behavior of system(). Some DOS compilers provide it and
> I
> > am depending on it and implementing it in my C library for DOS.
> As you wish. If you don't want to do it the proper way (with a POSIX
> compatible shell, since that is the part that returns the errorlevel to
> system), then parsing/interpreting the commandline is the only way I
> guess.
> But of course that is fragile. If sb uses 4/ndos it might already break,
> since that has more built-ins.
> Maybe looking at source of opensourced dos compilers (like watcom) can give
> you a clue. I don't have much experience of attempting to do POSIX outside
> *nix from an implementation viewpoint, since our runtime opts more for
> native.

DJGPP looks at the extension and executes .COM/.EXE directly if the extension is present.

OW seems to do that and also consult a list of what it thinks are COMMAND.COM's commands.

For me checking the extension and possibly traversing PATH is good enough.


Complete thread:

Back to the forum
Board view  Mix view
15317 Postings in 1383 Threads, 254 registered users, 15 users online (0 registered, 15 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum