writing cgi programs in c: the system() call.

Discussion in 'C Programming' started by jleslie48, Sep 22, 2008.

  1. jleslie48

    jleslie48 Guest

    I've written a cgi program in C using the borland 5.5 free compiler,
    and it runs just fine on an Apache server.

    My only issue is if I issue some system calls the cgi suspends until
    the call finishes. for example if in my c program I have a line:

    system("notepad");


    I can see with the taskmanager that an instance of notepad.exe is
    running, but its not on my desktop and the cgi program that made the
    system call suspends until I kill the notepad.exe process.

    I even tried imbedding the the notepad call in a .bat file as so:

    system("mybatfile.bat");

    mybatfile.bat:
    REM call a routine
    notepad t.txt


    I get the same result.

    If I re-write mybatfile.bat to some routine that completes
    automatically, all goes well for example:

    mybatfile.bat:
    REM a simple canned routine
    dir >t.txt

    this works fine and sure enough, there is a new file named t.txt
    created.

    What is the right way to call notepad from a cgi, I imagine one of the
    variations of spawn() or exec() will do the trick; I'm hoping some
    here will know.

    TIA,

    Jon
     
    jleslie48, Sep 22, 2008
    #1
    1. Advertising

  2. jleslie48

    Flash Gordon Guest

    jleslie48 wrote, On 22/09/08 21:55:
    > I've written a cgi program in C using the borland 5.5 free compiler,
    > and it runs just fine on an Apache server.


    Well, CGI's are not topical here, nor is your main problem which is a
    fundamental miss-understanding of things.

    > My only issue is if I issue some system calls the cgi suspends until
    > the call finishes.


    The C standard allows it to work that way.

    > for example if in my c program I have a line:
    >
    > system("notepad");


    Now, why on earth would you want to call notepad from a CGI? Where do
    you expect notepad will run? Where do you expect notepad to display its
    Window? Remember that notepad is a Windows program that pre-dates
    Windows having built-in support for networking.

    <snip>

    > I even tried imbedding the the notepad call in a .bat file as so:
    >
    > system("mybatfile.bat");
    >
    > mybatfile.bat:
    > REM call a routine
    > notepad t.txt


    Why would you get anything different?

    <snip>

    > What is the right way to call notepad from a cgi,


    There is not a correct way to do this. I don't know what you are trying
    to achieve, but whatever it is you are trying to use the wrong method.
    Ask in a web-development group (or web forum) about the real problem
    that you are trying to solve.

    > I imagine one of the
    > variations of spawn() or exec() will do the trick;


    Neither of those are standard C and I don't think they are standard
    Windows API calls either.

    > I'm hoping some
    > here will know.


    You are in luck that someone here can see that whatever you want to do
    you are using completely the wrong approach. As I say above, ask about
    your real problem (you no, the one you think can be solved by running
    notepad) in a web development group.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
     
    Flash Gordon, Sep 22, 2008
    #2
    1. Advertising

  3. In article <>,
    jleslie48 <> wrote:

    >My only issue is if I issue some system calls the cgi suspends until
    >the call finishes. for example if in my c program I have a line:
    >
    >system("notepad");
    >
    >
    >I can see with the taskmanager that an instance of notepad.exe is
    >running, but its not on my desktop and the cgi program that made the
    >system call suspends until I kill the notepad.exe process.


    I take it this is Microsoft Windows, which I'm not really familiar
    with, so this is just guesswork: in the other windowing operating
    systems I've used it's non-trivial for a "daemon" process like a web
    server to start up programs that display in the window system. For
    one thing, which user's desktop would they appear on? There is
    usually some inherited context (such as the DISPLAY environment
    variable in X on unix) that indicates that a program is running under
    the window system.

    Presumably there is documentation on the Microsoft web site about how
    to do this, but I can't help with finding it.

    You also have to consider just what it is you want to happen: what
    good does it do for a CGI script to open something on the desktop?
    Are you assuming that it's the person sitting at the screen who
    has caused the script to be run?

    -- Richard
    --
    Please remember to mention me / in tapes you leave behind.
     
    Richard Tobin, Sep 22, 2008
    #3
  4. jleslie48

    jleslie48 Guest

    On Sep 22, 4:55 pm, jleslie48 <> wrote:
    > I've written a cgi program in C using the borland 5.5 free compiler,
    > and it runs just fine on an Apache server.
    >
    > My only issue is if I issue some system calls the cgi suspends until
    > the call finishes.  for example if in my c program I have a line:
    >
    > system("notepad");
    >
    > I can see with the taskmanager that an instance of notepad.exe is
    > running, but its not on my desktop and the cgi program that made the
    > system call suspends until I kill the notepad.exe process.
    >
    > I even tried imbedding the the notepad call in a .bat file as so:
    >
    > system("mybatfile.bat");
    >
    > mybatfile.bat:
    > REM call a routine
    > notepad t.txt
    >
    > I get the same result.
    >
    > If I re-write mybatfile.bat to some routine that completes
    > automatically, all goes well for example:
    >
    > mybatfile.bat:
    > REM a simple canned routine
    > dir >t.txt
    >
    > this works fine and sure enough, there is a new file named t.txt
    > created.
    >
    > What is the right way to call notepad from a cgi, I imagine one of the
    > variations of spawn() or exec() will do the trick; I'm hoping some
    > here will know.
    >
    > TIA,
    >
    > Jon


    Thanks to all for your input. for reference purposes, I'm using a
    windoze xp pro OS, the borland 5.5 C++ compiler, an apache server, and
    no damned visual studio bloatware or windoze api behemoth. Just plain
    old c, putting out plain old ascii, that the apache server sends out
    to a browser that understands it as HTML code, nice and simple, ports
    to any linux, any windoze OS, or HP-UX machine. The fact that its a
    cgi is rather minor, accept that for some reason that I expect has to
    do with the parent-child inheritance rules, the system call doesn't
    launch the notepad process on the screen or the task bar at the
    bottom.

    I fully understand that this is a non-standard use of cgi, and I was
    only expecting to use this utility in a http://localhost environment,
    viz, the apache server that is responding to the form request from the
    browser are on the same machine. In other words, I want to open a
    browser window on the machine that is running the apache server, and
    have it open a notepad session on a file that I want the nighttime
    operator to do some changes to.

    I've looked around for better fit usergroups, but after an hour or so,
    this one seemed to be the only one that at least talks about
    programming in C. None of the others seem to do any real
    programming.
     
    jleslie48, Sep 22, 2008
    #4
  5. In article <>,
    jleslie48 <> wrote:
    >On Sep 22, 4:55 pm, jleslie48 <> wrote:
    >> I've written a cgi program in C using the borland 5.5 free compiler,
    >> and it runs just fine on an Apache server.
    >>
    >> My only issue is if I issue some system calls the cgi suspends until
    >> the call finishes.  for example if in my c program I have a line:
    >>
    >> system("notepad");


    Your explanation makes everything clear. Ignore the retards who
    continue to pretend either that they have no idea what you are talking
    about or assume (despite all your statements to the contrary) that you
    are running on Unix and/or a headless server box.

    Anyway, I think what you are looking for is:

    system("start notepad");

    That is, incidentally, the equivalent of:

    system("notepad &");

    in the Unix world...
     
    Kenny McCormack, Sep 23, 2008
    #5
  6. (Gordon Burditt) writes:
    [...]
    >> jleslie48 <> writes:
    >>> I've written a cgi program in C using the borland 5.5 free compiler,
    >>> and it runs just fine on an Apache server.

    >
    > CGI runs on a *server*. A server need not even have a monitor.
    > Even if it does, it may be used only when the system is rebooted,
    > and shared with a dozen other systems via a big KVM switch.
    >
    >>> My only issue is if I issue some system calls the cgi suspends until
    >>> the call finishes.  for example if in my c program I have a line:
    >>>
    >>> system("notepad");

    >
    > What does
    > system("notepad &");
    > do? It might avoid the suspension until the call finishes (it would
    > on UNIX), or it might just result in notepad complaining about its
    > command-line arguments.


    The OP is running on Windows XP. Appending "&" to the command will do
    nothing useful. For details, as in a Windows newsgroup.

    To the original poster: There is (or was) a newsgroup that discusses
    CGI programming, comp.infosystems.www.authoring.cgi. Or you can try
    comp.os.ms-windows.programmer.win32. I don't think you'll get any
    directly useful information in comp.lang.c, just suggestions to ask
    elsewhere (which is useful, but only indirectly) and bad guesses.

    I've restored the attribution line that Gordon snipped. Permission to
    quote this article without attribution is denied.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Sep 23, 2008
    #6
  7. jleslie48

    Flash Gordon Guest

    Kenny McCormack wrote, On 23/09/08 00:30:
    > In article <>,
    > jleslie48 <> wrote:
    >> On Sep 22, 4:55 pm, jleslie48 <> wrote:
    >>> I've written a cgi program in C using the borland 5.5 free compiler,
    >>> and it runs just fine on an Apache server.
    >>>
    >>> My only issue is if I issue some system calls the cgi suspends until
    >>> the call finishes. for example if in my c program I have a line:
    >>>
    >>> system("notepad");

    >
    > Your explanation makes everything clear.


    It makes it clear the OP is trying to do something that won't work.

    > Ignore the retards who
    > continue to pretend either that they have no idea what you are talking
    > about or assume (despite all your statements to the contrary) that you
    > are running on Unix and/or a headless server box.


    I made none of those assumptions.

    > Anyway, I think what you are looking for is:
    >
    > system("start notepad");


    Which won't work for the OP for precicely the same reasons that the OP
    is not getting notepad displayed currently.

    > That is, incidentally, the equivalent of:
    >
    > system("notepad &");
    >
    > in the Unix world...


    Something I at least was fully aware of. I did not suggest it because it
    does not solve the OP's problem, and if Apache is even vaguely sensibly
    designed it will make it as hard as possible to launch a usable instance
    of notepad and Windows will actually cooperate in making it hard. This
    is why the OP needs to discuss the real problem somewhere it is topical,
    a completely different solution will be required.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
     
    Flash Gordon, Sep 23, 2008
    #7
  8. In article <-gordon.me.uk>,
    Flash Gordon <> wrote:
    >Kenny McCormack wrote, On 23/09/08 00:30:
    >> In article

    ><>,
    >> jleslie48 <> wrote:
    >>> On Sep 22, 4:55 pm, jleslie48 <> wrote:
    >>>> I've written a cgi program in C using the borland 5.5 free compiler,
    >>>> and it runs just fine on an Apache server.
    >>>>
    >>>> My only issue is if I issue some system calls the cgi suspends until
    >>>> the call finishes. for example if in my c program I have a line:
    >>>>
    >>>> system("notepad");

    >>
    >> Your explanation makes everything clear.

    >
    >It makes it clear the OP is trying to do something that won't work.


    Maybe, maybe not. But the OP's specific problem - the reason he posted
    (go back and look at the original text if you like) - was that the
    system() function was "hanging" (a word that probably doesn't occur in
    your precious "standard", but I think you know what I mean). He could
    tell from "task manager" (or whatever system processes monitoring
    software he is using) that notepad was running, but the problem was that
    his batch file was "hanging". Using "start" will fix that. So, I have
    answered the question as posted.

    Now, as for whether or not that will cause a window to pop up on the
    operator's screen - that's another question entirely. But that was *not*
    the question posted. If that is an issue for the OP (and we have no way
    of knowing whether it is - but I see that you have made your usual set
    of assumptions), then that fact will come out eventually, and we can
    deal with it when it does.
     
    Kenny McCormack, Sep 23, 2008
    #8
  9. jleslie48

    Flash Gordon Guest

    Kenny McCormack wrote, On 23/09/08 21:58:
    > In article <-gordon.me.uk>,
    > Flash Gordon <> wrote:
    >> Kenny McCormack wrote, On 23/09/08 00:30:
    >>> In article

    >> <>,
    >>> jleslie48 <> wrote:
    >>>> On Sep 22, 4:55 pm, jleslie48 <> wrote:
    >>>>> I've written a cgi program in C using the borland 5.5 free compiler,
    >>>>> and it runs just fine on an Apache server.
    >>>>>
    >>>>> My only issue is if I issue some system calls the cgi suspends until
    >>>>> the call finishes. for example if in my c program I have a line:
    >>>>>
    >>>>> system("notepad");
    >>> Your explanation makes everything clear.

    >> It makes it clear the OP is trying to do something that won't work.

    >
    > Maybe, maybe not.


    Well, if you think the OP was trying to generate a hung process you
    could have suggested easier methods.

    > But the OP's specific problem - the reason he posted
    > (go back and look at the original text if you like) - was that the
    > system() function was "hanging" (a word that probably doesn't occur in
    > your precious "standard", but I think you know what I mean). He could


    I know exactly what he meant, and from the fact that he comments, "but
    its not on my desktop" it is obvious to anyone who knows about Windows
    and notepad that this is a problem.

    <snip>

    > Now, as for whether or not that will cause a window to pop up on the
    > operator's screen - that's another question entirely.


    Now you are doing exactly what you complain about the "regs", including
    me, doing and deliberately not dealing with the problem the OP obviously
    has.

    > But that was *not*
    > the question posted.


    It *was* included in the original post.

    > If that is an issue for the OP (and we have no way
    > of knowing whether it is - but I see that you have made your usual set
    > of assumptions),


    You mean assuming the OP wants a solution that will work?

    > then that fact will come out eventually, and we can
    > deal with it when it does.


    The only facts required to know the OP is barking up a tree in
    completely the wrong forest were in the original post. If you don't know
    enough about Windows to know that then don't complain at people who *do*
    know enough for telling someone they need a completely different approach.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
     
    Flash Gordon, Sep 23, 2008
    #9
  10. jleslie48

    jleslie48 Guest

    On Sep 22, 4:55 pm, jleslie48 <> wrote:
    > I've written a cgi program in C using the borland 5.5 free compiler,
    > and it runs just fine on an Apache server.
    >
    > My only issue is if I issue some system calls the cgi suspends until
    > the call finishes.  for example if in my c program I have a line:
    >
    > system("notepad");
    >
    > I can see with the taskmanager that an instance of notepad.exe is
    > running, but its not on my desktop and the cgi program that made the
    > system call suspends until I kill the notepad.exe process.
    >
    > I even tried imbedding the the notepad call in a .bat file as so:
    >
    > system("mybatfile.bat");
    >
    > mybatfile.bat:
    > REM call a routine
    > notepad t.txt
    >
    > I get the same result.
    >
    > If I re-write mybatfile.bat to some routine that completes
    > automatically, all goes well for example:
    >
    > mybatfile.bat:
    > REM a simple canned routine
    > dir >t.txt
    >
    > this works fine and sure enough, there is a new file named t.txt
    > created.
    >
    > What is the right way to call notepad from a cgi, I imagine one of the
    > variations of spawn() or exec() will do the trick; I'm hoping some
    > here will know.
    >
    > TIA,
    >
    > Jon


    thanks again for all answers. I will try the "start notepad" on
    wednesday, I was away from my desk today. If my cgi.exe program
    completes, that at least solves half my problem and gets me closer to
    a solution. From the borland help files I can see that exec() and
    spawn() have a whole host of variations and flavors, changing the
    rules of dependency, parent-child status etc. I guess I just have to
    use trial and terror to see. I was hoping someone would have tried
    something like this. Maybe fork() would also work, however, that is
    the one that I would of expected to fail though, as that WOULD work
    with exactly the same envrionment as the apache server, aka, as a
    background task without a user interface.

    I highly doubt I'm running into any security issue, as there is
    nothing from preventing me from executing a bat file that "del/q/f/s c:
    \windows" as that command requires no user input. You'd think the boys
    as Microsoft would of plugged that one before silly old notepad.

    quite frankly I don't think this is a big stretch for this group.
    This is pretty straightforward C programming, and not a cgi issue.
    Most cgi programmers would be lost in the C world, and all their GUI
    "write software for me" packages just make a mess out of understanding
    things, so those folks are mostly useless. I think if you write any
    background task for windoze xp and have it launch notepad I would have
    the same issue, but I don't even know how I could write that. I'm
    just a simple old command line programmer.

    The html/cgi/forms environment is a very easy interface to work with,
    gives me full access to all the installed files and software on my
    computer, and I'm really just using the apache server as a means to a
    nice interface so that the interns who run the place at night can be
    trained much faster and their jobs are made as simple as possible.
    Using this technique I've managed to get a whole host of things done
    that I never could of without a staff of nighttime operators that were
    much more computer literate. Now I want them to be dropped into a
    notepad session for whatever reason I have. That reason is
    unimportant. I'm quite sure it can be done. Heck the dos prompt does
    it.
     
    jleslie48, Sep 24, 2008
    #10
  11. jleslie48 <> writes:
    [...]
    > quite frankly I don't think this is a big stretch for this group.
    > This is pretty straightforward C programming, and not a cgi issue.
    > Most cgi programmers would be lost in the C world, and all their GUI
    > "write software for me" packages just make a mess out of understanding
    > things, so those folks are mostly useless. I think if you write any
    > background task for windoze xp and have it launch notepad I would have
    > the same issue, but I don't even know how I could write that. I'm
    > just a simple old command line programmer.

    [...]

    Standard C has no concept of "background tasks", which is exactly why
    this isn't the right place for your question.

    Have you tried posting to comp.os.ms-windows.programmer.win32?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Sep 24, 2008
    #11
  12. jleslie48

    Flash Gordon Guest

    jleslie48 wrote, On 24/09/08 01:39:

    <snip>

    > thanks again for all answers. I will try the "start notepad" on
    > wednesday, I was away from my desk today. If my cgi.exe program


    Well, it won't work. Feel free to waste your time though.

    > completes, that at least solves half my problem and gets me closer to
    > a solution. From the borland help files I can see that exec() and
    > spawn() have a whole host of variations and flavors, changing the


    They are non-standard and only Boreland programmers will know about
    them. However, they definitely should *not* work.

    <snip>

    > with exactly the same envrionment as the apache server, aka, as a
    > background task without a user interface.


    Here you are getting closer to the problem, but there is more to it than
    that.

    > I highly doubt I'm running into any security issue, as there is
    > nothing from preventing me from executing a bat file that "del/q/f/s c:
    > \windows" as that command requires no user input. You'd think the boys
    > as Microsoft would of plugged that one before silly old notepad.


    It isn't notepad as such that is the problem. However, this is not the
    correct place to discus it.

    > quite frankly I don't think this is a big stretch for this group.
    > This is pretty straightforward C programming, and not a cgi issue.


    No, it's not a cgi problem, it's a Windows problem you would have with
    all sorts of other software as well.

    > Most cgi programmers would be lost in the C world, and all their GUI
    > "write software for me" packages just make a mess out of understanding
    > things, so those folks are mostly useless.


    Shows how little you know. I say that as someone who has written CGI's
    in Unix and work with people who write web based applications.

    <snip>

    > The html/cgi/forms environment is a very easy interface to work with,
    > gives me full access to all the installed files and software on my
    > computer, and I'm really just using the apache server as a means to a
    > nice interface so that the interns who run the place at night can be
    > trained much faster and their jobs are made as simple as possible.


    Now you are finding out why it is the wrong tool for the job.

    > Using this technique I've managed to get a whole host of things done
    > that I never could of without a staff of nighttime operators that were
    > much more computer literate. Now I want them to be dropped into a
    > notepad session for whatever reason I have. That reason is
    > unimportant. I'm quite sure it can be done.


    So ask somewhere they might know about the internals of Windows.

    > Heck the dos prompt does
    > it.


    The DOS prompt is running in a *very* different context. If you don't
    understand that then you are a long way from being able to understand
    what the problem is, and until you understand the problem you are in no
    position to udge whether it might be possible.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
     
    Flash Gordon, Sep 24, 2008
    #12
  13. jleslie48

    James Kuyper Guest

    Flash Gordon wrote:
    > jleslie48 wrote, On 24/09/08 01:39:

    ....
    >> completes, that at least solves half my problem and gets me closer to
    >> a solution. From the borland help files I can see that exec() and
    >> spawn() have a whole host of variations and flavors, changing the

    >
    > They are non-standard and only Boreland programmers will know about
    > them. However, they definitely should *not* work.


    I agree that they are non-standard, and therefore off-topic. However,
    they are not Borland-specific; I've seen the same (or at least similar)
    functions available on a wide variety of compilers.
     
    James Kuyper, Sep 24, 2008
    #13
  14. In article <QPoCk.985$>,
    James Kuyper <> wrote:
    >Flash Gordon wrote:
    >> jleslie48 wrote, On 24/09/08 01:39:

    >...
    >>> completes, that at least solves half my problem and gets me closer to
    >>> a solution. From the borland help files I can see that exec() and
    >>> spawn() have a whole host of variations and flavors, changing the

    >>
    >> They are non-standard and only Boreland programmers will know about
    >> them. However, they definitely should *not* work.

    >
    >I agree that they are non-standard, and therefore off-topic. However,
    >they are not Borland-specific; I've seen the same (or at least similar)
    >functions available on a wide variety of compilers.


    But that is the terminology of this newsgroup. If something is
    implemented in 99% of the platforms that we care about (note that I am
    not making that specific claim about the functions in question here),
    they call it "implementation specific". They are not using the word
    "specific" in the sense that ordinary English speakers do.

    Note also that they claim that something is not C (and is no more C
    than, say, Heathfield's ass) if it really is 98% C.

    Total lack of common sense.
     
    Kenny McCormack, Sep 24, 2008
    #14
  15. On 24 Sep, 02:09, Keith Thompson <> wrote:
    > jleslie48 <> writes:


    > Have you tried posting to comp.os.ms-windows.programmer.win32?


    this group is active and helpful.
    They are much nicer than clc! :)

    --
    Nick Keighley
     
    Nick Keighley, Sep 24, 2008
    #15
  16. jleslie48

    James Kuyper Guest

    Kenny McCormack wrote:
    > In article <QPoCk.985$>, James Kuyper
    > <> wrote:
    >> Flash Gordon wrote:
    >>> jleslie48 wrote, On 24/09/08 01:39:

    >> ...
    >>>> completes, that at least solves half my problem and gets me
    >>>> closer to a solution. From the borland help files I can see
    >>>> that exec() and spawn() have a whole host of variations and
    >>>> flavors, changing the
    >>> They are non-standard and only Boreland programmers will know
    >>> about them. However, they definitely should *not* work.

    >> I agree that they are non-standard, and therefore off-topic.
    >> However, they are not Borland-specific; I've seen the same (or at
    >> least similar) functions available on a wide variety of compilers.

    >
    > But that is the terminology of this newsgroup. If something is
    > implemented in 99% of the platforms that we care about (note that I
    > am not making that specific claim about the functions in question
    > here), they call it "implementation specific". ...


    I would not have objected if he had called them "implementation
    specific". That is exactly the correct term. He said that "only Boreland
    programmers will know about them", and that is NOT correct.

    > ... They are not using the word "specific" in the sense that
    > ordinary English speakers do.


    Definition 4 a) at

    <http://www.ask.com/web?q=dictionary%3A+specific&content=ahdict%7C5141&o=0&l=dir>

    is the one that is most closely related to the concept of
    "implementation specific". The example given by that definition is
    "age-specific voting patterns". That term means "voting patterns which
    are different for different age groups". An "implementation-specific
    value" means a "value which is different for different implementations".

    It doesn't matter if 99% of the age groups all vote identically; if the
    remaining 1% of the age groups vote in a significantly different
    pattern, the voting pattern is age-specific. Similarly, it doesn't
    matter if a function is provided by 99% of the implementations. If the
    remaining 1% of the implementations do not provide it, then support for
    that function is implementation-specific.

    ....
    > Total lack of common sense.


    Common sense isn't what's it's cracked up to be. It's neither common,
    nor sensical, nor is it a good guide to follow when discussions get
    technical.

    Common sense used to say that the world was, overall, flat. Only those
    scholars in their Ivory towers with their heads in the clouds would
    natter on about how the evidence (such as lunar eclipses) showed that
    Earth had to be spherical. I would not recommend navigating a vessel on
    any transoceanic voyages using such "common sense". Stick to
    coastal-hopping, it's safer.
     
    James Kuyper, Sep 24, 2008
    #16
  17. jleslie48

    Flash Gordon Guest

    James Kuyper wrote, On 24/09/08 11:41:
    > Flash Gordon wrote:
    >> jleslie48 wrote, On 24/09/08 01:39:

    > ...
    >>> completes, that at least solves half my problem and gets me closer to
    >>> a solution. From the borland help files I can see that exec() and
    >>> spawn() have a whole host of variations and flavors, changing the

    >>
    >> They are non-standard and only Boreland programmers will know about
    >> them. However, they definitely should *not* work.

    >
    > I agree that they are non-standard, and therefore off-topic. However,
    > they are not Borland-specific; I've seen the same (or at least similar)
    > functions available on a wide variety of compilers.


    I'm not aware of them being available on a wide variety of Windows
    compilers and would not guarantee they behave the same as the Posix
    functions with similar names or the MS functions with slightly different
    names. However, I do accept that they are not necessarily specific to
    Borland.
    --
    Flash Gordon
    If spamming me sent it to
    If emailing me use my reply-to address
    See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
     
    Flash Gordon, Sep 24, 2008
    #17
  18. jleslie48

    jleslie48 Guest

    ]
    >
    > Standard C has no concept of "background tasks", which is exactly why
    > this isn't the right place for your question.
    >


    Standard C is completely based on background tasks. the "system",
    "exec", "fork", family of library functions are some of the most
    fundamental of the language. K&R's first edition introduced them, the
    entire UNIX operating system is built with them, and the current K&R
    book continues with all of the constructs of the Parent-Child
    paradigm.

    The >system("start notepad");< command does free up my cgi to
    respond, but alas as predicted, I still don't have a desktop
    addressable notepad session.
     
    jleslie48, Sep 26, 2008
    #18
  19. jleslie48

    jleslie48 Guest


    > Standard C has no concept of "background tasks", which is exactly why
    > this isn't the right place for your question.
    >


    I guess I'm running into trouble with the Windoze vs UNIX
    implementations.
    K&R and Pike detail very early on the relationship of C and the UNIX
    OS with the "system", "exec", "fork", family of library functions as
    some of the most
    fundamental of the language.

    The >system("start notepad");< command does free up my cgi to
    respond, but alas as predicted, I still don't have a desktop
    addressable notepad session.
     
    jleslie48, Sep 26, 2008
    #19
  20. jleslie48

    CBFalconer Guest

    jleslie48 wrote:
    >

    .... snip ...
    >
    > Standard C is completely based on background tasks. the "system",
    > "exec", "fork", family of library functions are some of the most
    > fundamental of the language. K&R's first edition introduced them,
    > the entire UNIX operating system is built with them, and the
    > current K&R book continues with all of the constructs of the
    > Parent-Child paradigm.


    You are very wrong. Standard C doesn't include exec or fork in any
    form. Unix is not built on Standard C, if that means "limited to".

    Some useful references about C:
    <http://www.ungerhu.com/jxh/clc.welcome.txt>
    <http://c-faq.com/> (C-faq)
    <http://benpfaff.org/writings/clc/off-topic.html>
    <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf> (C99)
    <http://cbfalconer.home.att.net/download/n869_txt.bz2> (pre-C99)
    <http://www.dinkumware.com/c99.aspx> (C-library}
    <http://gcc.gnu.org/onlinedocs/> (GNU docs)
    <http://clc-wiki.net/wiki/C_community:comp.lang.c:Introduction>

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home.att.net>
    Try the download section.
     
    CBFalconer, Sep 26, 2008
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    12
    Views:
    1,702
    Dave Thompson
    Jan 10, 2005
  2. Coca
    Replies:
    7
    Views:
    776
    Aidan Grey
    Aug 24, 2004
  3. Replies:
    18
    Views:
    656
    Dave Thompson
    Jan 10, 2005
  4. lone_eagle
    Replies:
    3
    Views:
    669
    psykeedelik
    May 26, 2009
  5. Casey Hawthorne
    Replies:
    14
    Views:
    468
Loading...

Share This Page