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 marcov(R), 18.09.2014, 12:18

> > The problem is there's no
> > way you can know what that is. The only sane thing you can do is a
> > "%COMSPEC% /C ..." and figure out some other way to return the
> ErrorLevel
> > if that's critical to you.
>
> That's the very problem I came with. I don't need it to be restated to me.
> Can you be more specific? Otherwise, those are empty and meaningless words.

If you are so focussed on the exitcode, I think simplest is having both. One focusses on errorlevel, and one that really always runs the shell.

Depending on the codebases that you run, you select the variant that gets the system() identifier. Or make it an alias even depending on a define in the header. (like #ifdef unicode in windows headers)

And document it very, very thoroughly.

 

Complete thread:

Back to the forum
Board view  Mix view
15196 Postings in 1365 Threads, 250 registered users, 14 users online (1 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum