Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > writing cgi programs in c: the system() call.

Reply
Thread Tools

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

 
 
Keith Thompson
Guest
Posts: n/a
 
      09-24-2008
jleslie48 <(E-Mail Removed)> 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.velocityreviews.com/forums/(E-Mail Removed) <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"
 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      09-24-2008
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 (E-Mail Removed)
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
 
Reply With Quote
 
 
 
 
James Kuyper
Guest
Posts: n/a
 
      09-24-2008
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.
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      09-24-2008
In article <QPoCk.985$(E-Mail Removed)>,
James Kuyper <(E-Mail Removed)> 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.

 
Reply With Quote
 
Nick Keighley
Guest
Posts: n/a
 
      09-24-2008
On 24 Sep, 02:09, Keith Thompson <(E-Mail Removed)> wrote:
> jleslie48 <(E-Mail Removed)> 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
 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      09-24-2008
Kenny McCormack wrote:
> In article <QPoCk.985$(E-Mail Removed)>, James Kuyper
> <(E-Mail Removed)> 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.
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      09-24-2008
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 (E-Mail Removed)
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
 
Reply With Quote
 
jleslie48
Guest
Posts: n/a
 
      09-26-2008
]
>
> 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.
 
Reply With Quote
 
jleslie48
Guest
Posts: n/a
 
      09-26-2008

> 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.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-26-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieveing programs deleted in add or remove programs in control panel truebluedave Computer Support 2 08-23-2005 10:32 PM
Programs take a long time to launch from A.Programs Me MCSE 9 01-20-2005 04:05 PM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C++ 12 01-10-2005 03:35 AM
Re: How to see all programs after Start -> All Programs Ben Leal Computer Support 1 08-06-2003 01:58 AM



Advertisments