Question about pipes

M

Madhusudan Singh

Hi

Just a basic question from someone who is new to pipes.

The statement of the problem is simple :

Instead of using popen(progname,"w"), I wish to use the elementary
functions pipe, fork, dup2, etc. to get the same effect.

You may well wonder why I am trying to do this - I am programming in
another language (Fortran 95) where a library provides equivalents for
pipe(), fork(), dup2() etc., but for popen().

I do NOT wish to depend upon underscores in the object code and want to
make my code pure Fortran 95.

I would appreciate it if someone could give me a flowchart (with proper
calls like pipe() with the arguments).

Thanks,

MS
 
J

Jack Klein


Cross-posting to more than one group but leaving some out of the
followups setting is just plain rude. I would say you've worn out
your welcome in comp.lang.c.
Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.

Kindly keep your Linux specific questions out of comp.lang.c in the
future, at least until you learn some manners, jerk.

*plonk*
 
M

Madhusudan Singh

Cross-posting to more than one group but leaving some out of the
followups setting is just plain rude. I would say you've worn out
your welcome in comp.lang.c.

Thanks for speaking on behalf of the newsgroup.

And if one makes the list of NG's posted to identical to the list of NG's in
the follow-up, it would pretty much defeat the purpose of setting a
follow-up, wouldn't it ?
Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.

Thank you for the answer, o prescient one.
Kindly keep your Linux specific questions out of comp.lang.c in the
future, at least until you learn some manners, jerk.

As Scrooge might have said, such bile can be no more than some ill digested
gravy.

Might want to cook the dinner better next time.

Welcome to my kill file.
 
M

Madhusudan Singh

Hi

Just a basic question from someone who is new to pipes.

The statement of the problem is simple :

Instead of using popen(progname,"w"), I wish to use the elementary
functions pipe, fork, dup2, etc. to get the same effect.

You may well wonder why I am trying to do this - I am programming
in
another language (Fortran 95) where a library provides equivalents for
pipe(), fork(), dup2() etc., but for popen().

I do NOT wish to depend upon underscores in the object code and
want to
make my code pure Fortran 95.

I would appreciate it if someone could give me a flowchart (with
proper
calls like pipe() with the arguments).

Thanks,

MS

Thanks to all that responded. I have reposted my query on the NG
comp.unix.programmer.
 
R

Richard Heathfield

Jack said:
Cross-posting to more than one group but leaving some out of the
followups setting is just plain rude.

No, it isn't. It's common sense. (It is, however, courteous to point out in
the body of the article that followups have been set.)

In this case, I have not set followups. I'm uncomfortable with that
decision, though.
I would say you've worn out
your welcome in comp.lang.c.

I disagree. I think he just screwed up by asking an off-topic question.
People do, you know.

Kindly keep your Linux specific questions out of comp.lang.c in the
future, at least until you learn some manners, jerk.

Bad hair day, Jack? :)
 
J

Jack Klein

No, it isn't. It's common sense. (It is, however, courteous to point out in
the body of the article that followups have been set.)

In this case, I have not set followups. I'm uncomfortable with that
decision, though.


I disagree. I think he just screwed up by asking an off-topic question.
People do, you know.



Bad hair day, Jack? :)

It may be appropriate to set followups in a reply, it is not
appropriate to do so in a post. See if you can figure out why.
 
E

E. Robert Tisdale

Madhusudan said:
Just a basic question from someone who is new to pipes.

The statement of the problem is simple :

Instead of using popen(progname,"w"),
I wish to use the elementary functions pipe, fork, dup2, etc.
to get the same effect.
You may well wonder why I am trying to do this -
I am programming in another language (Fortran 95)
where a library provides equivalents
for pipe(), fork(), dup2() etc., but [not] for popen().
I do NOT wish to depend upon underscores in the object code
and want to make my code pure Fortran 95.

I would appreciate it if someone could give me a flowchart
(with proper calls like pipe() with the arguments).

I see that you've already met our indigenous trolls.
If you decide to become a regular subscriber,
you will learn to recognize and ignore them.


POPEN(3) Linux Programmer’s Manual POPEN(3)

NAME
popen, pclose - process I/O

SYNOPSIS
#include <stdio.h>

FILE *popen(const char* command, const char* type);

int pclose(FILE* stream);
.
.
.
CONFORMING TO
POSIX.2

POSIX pipes not a part of the ANSI/ISO C [89]9 standards.

Fortran 95 doesn't have input/output streams (FILE pointers)
so it's hard to imagine how you might implement popen
and that's probably why it isn't part of your library.
 
R

Richard Heathfield

It may be appropriate to set followups in a reply, it is not
appropriate to do so in a post. See if you can figure out why.

Please educate me, because I just don't see it. It seems to me that it makes
perfect sense, if you *must* cross-post, to set followups right at the
outset, in the very first article.
 
C

Chris F.A. Johnson

Please educate me, because I just don't see it. It seems to me that it makes
perfect sense, if you *must* cross-post, to set followups right at the
outset, in the very first article.

And only in the first post; if people reply using follow-ups, the
thread can splinter into a different thread in each newsgroup.
 
J

Joona I Palaste

Madhusudan Singh <[email protected]> scribbled the following
Thanks for speaking on behalf of the newsgroup.
And if one makes the list of NG's posted to identical to the list of NG's in
the follow-up, it would pretty much defeat the purpose of setting a
follow-up, wouldn't it ?

But why did you write to comp.lang.c in the first place? You knew your
question was off-topic, otherwise you wouldn't have set follow-ups. Did
you want to anger people here on purpose?
Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.
Thank you for the answer, o prescient one.
As Scrooge might have said, such bile can be no more than some ill digested
gravy.
Might want to cook the dinner better next time.
Welcome to my kill file.

I think Jack Klein was right on this one. Rude, but right. Posting a
question on comp.lang.c just to get answers *on a different newsgroup*
is quite strange. It is as if you wanted to state "this question is
off-topic, I know, but I'll ask it here anyway, because I just don't
care!".

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Parthenogenetic procreation in humans will result in the founding of a new
religion."
- John Nordberg
 
L

Leor Zolman


Cross-posting to more than one group but leaving some out of the
followups setting is just plain rude. I would say you've worn out
your welcome in comp.lang.c.
Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.

Kindly keep your Linux specific questions out of comp.lang.c in the
future, at least until you learn some manners, jerk.

*plonk*

Yikes.

Let's see, here's /some/ of the ways I can recall having screwed up during
my first couple of months of active newsgroup posting:

1. Wrong answer (outdated assumptions)
2. Wrong answer (brain death)
3. Wrong answer (code wouldn't compile)
4. Wrong answer (code compiles, does wrong thing)
5. Partly wrong answer (myriad flavors)
5. Right answer (but not to the OP's question)
6. Gave inappropriate response for the group I was in (it wasn't the
"learn" group...)
7. Sent Partial Post accidentally (didn't know what Ctrl-N did in Agent)
7a. Didn't correct that right away (never knew it got sent)
8. Posted same response twice (two occasions, Agent locked up on send,
didn't know msgs got posted)

I'm sure there are others.

Given my track record, if/when I ever decide that "now's the time" to begin
fiddling with the Follow-up settings, there's a decent chance I'll find a
way to screw that up too. So let me just apologize in advance, because
whatever the reason/excuse I'll come up with for it, I promise the action
(or any /other/ goof) will not be a result of any conscious attempt to
circumvent this (or any) group's posting etiquette.

Obviously, I'm lobbying for extending the benefit of the doubt to folks, at
least the first time they make a particular mistake (or in my case, I'd
appreciate some slack on the 2nd as well. Third time, bring it on, I'd
deserve it). Searching reveals only one other post ever in clc by the OP,
from over two years ago, so it isn't as if he were a repeat offender...
-leor


Leor Zolman
BD Software
(e-mail address removed)
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html
 
M

Madhusudan Singh

[Follow up changed to comp.lang.c as this subthread now has more to do with
the brittle egos of the denizens of comp.lang.c than anything germane to my
initial query.]
But why did you write to comp.lang.c in the first place? You knew your
question was off-topic, otherwise you wouldn't have set follow-ups. Did
you want to anger people here on purpose?

How do you know that I knew my question was off topic ? As I stated, I am
new to pipes.

If you people are that quick to anger because of a mistake, maybe you should
keep offline so that all the small accidental aggravating factors like me
don't bother you.

Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.
Thank you for the answer, o prescient one.
As Scrooge might have said, such bile can be no more than some ill
digested gravy.
Might want to cook the dinner better next time.
Welcome to my kill file.

I think Jack Klein was right on this one. Rude, but right. Posting a
question on comp.lang.c just to get answers *on a different newsgroup*
is quite strange. It is as if you wanted to state "this question is
off-topic, I know, but I'll ask it here anyway, because I just don't
care!".

FWIW, all the code that uses popen() etc, that I have seen has been written
in C or C++. So, I made a mistake, thinking that maybe a special C library
contained popen() etc, and quite possibly people on comp.lang.c would know.

I just hope that a bunch of sanctimonious freaks like you can now leave me
in peace. Next time, even if I have an ANSI C related question, I will ask
someone offline or use Google.
 
T

Thomas Stegen CES2000

Madhusudan said:
How do you know that I knew my question was off topic ? As I stated, I am
new to pipes.

If you people are that quick to anger because of a mistake, maybe you should
keep offline so that all the small accidental aggravating factors like me
don't bother you.

FWIW, I hang around here quite a bit and I consider your question
off topic. But the response you got was quite a bit over the top
and does not reflect the general behaviour of the regulars in this
newsgroup. More often that not you would get a simple redirect with
maybe a snide remark or two if you did something really silly, but
the replies you got in this were over the top and not normal.
 
N

nrk

Joona said:
Madhusudan Singh <[email protected]> scribbled the following




But why did you write to comp.lang.c in the first place? You knew your
question was off-topic, otherwise you wouldn't have set follow-ups. Did
you want to anger people here on purpose?

Unclarified and unwarranted assumption. Do *you* know that the OP was
certain about the off-topic nature of his question in CLC? I would give a
newcomer the benefit of doubt here and assume that he/she didn't know the
off-topical nature of their query in CLC (because they don't regularly
subscribe to it), and since they don't regularly subscribe to CLC, but do
read COLM regularly, sets follow-ups to COLM. Did you avoid being rational
on purpose?
Just a basic question from someone who is new to pipes.

[snip platform specific code]

Well, rude one, your post is off topic in comp.lang.c. There are no
pipes in C, nor any of the other functions you mentioned in the part I
snipped. There is no such thing as ADA or FORTRAN in C either.
Thank you for the answer, o prescient one.
As Scrooge might have said, such bile can be no more than some ill
digested gravy.
Might want to cook the dinner better next time.
Welcome to my kill file.

I think Jack Klein was right on this one. Rude, but right. Posting a
question on comp.lang.c just to get answers *on a different newsgroup*
is quite strange. It is as if you wanted to state "this question is
off-topic, I know, but I'll ask it here anyway, because I just don't
care!".

No. That's an unwarranted assumption you and Jack seem to have made about
OP without any factual background. From my POV, it makes perfect sense for
me to set follow-ups to a group that I regularly follow, while
cross-posting to several where I expect relevant and useful answers (I
might be wrong with my choice of groups though). It's easy to start
frothing at the mouth before thinking about something. Jack's reply was
unnecessarily rude. I don't mind curt redirections to off-topic questions,
but gratuituous rudeness like that from a regular towards a newcomer
doesn't show CLC in a good light. I much prefer what Christopher does with
his standard re-directs referring people to the faq and Ben's suggestions
for off-topic questions.

If you want to see some consistent inconsistency, see how the right hon'ble
Marcia Hon has been dealt with so far.

To OP:
Jack's response was unfortunate, and as you can see, not many regulars agree
with the tone, but they agree with part of it: Your question is not
topical in CLC as we discuss only the C language as described by the
ANSI/ISO standards. If you plan to subscribe regularly to CLC, you might
want to remove Jack from your killfile. To topical questions, he posts
erudite, correct answers and is a knowledgeable and respected contributor
here.
Before posting further questions, please do take the time to go through the
fine FAQ:
http://www.eskimo.com/~scs/C-faq/top.html

-nrk.
 
K

Keith Thompson

Madhusudan Singh said:
Thanks for speaking on behalf of the newsgroup.
[snip]

Madhusudan Singh, I suspect Jack Klein was just having a bad day.

You did make a couple of mistakes. Pipes (as you now know) are not
part of standard C, and are therefore off-topic in comp.lang.c (though
asking whether pipes are topical would be perfectly topical). And
cross-posting an initial article (not a followup) to two newsgroups
and setting followups to just one of them is a bit odd; I think Jack
overreacted to that. If your original article were topical to both
newsgroups, it wouldn't make much sense to redirect followups away
from comp.lang.c; if it weren't, it wouldn't make much sense to
crosspost in the first place. And if you're going to redirect
followups, you should probably mention it in the body of your post, so
readers know where the discussion is going. Redirecting followups
makes sense later in a discussion if the topic has drifted; it's
seldom the right thing to do on an initial post.

comp.lang.c fights a continuous battle to remain focused on its topic.
It's a high-volume newsgroup with a name that suggests to some
(incorrectly) that it's the place to ask any question about C
programming. We're in constant danger of being overwhelmed with
system-specific questions that we're really not qualified to answer.
(Yeah, I'm probably overstating the case a bit.) We're usually
reasonably polite about letting people know that this isn't the right
place for their questions, but we are imperfect.
 
M

Mark McIntyre

[Follow up changed to comp.lang.c as this subthread now has more to do with
the brittle egos of the denizens of comp.lang.c than anything germane to my
initial query.]
But why did you write to comp.lang.c in the first place? You knew your
question was off-topic, otherwise you wouldn't have set follow-ups. Did
you want to anger people here on purpose?

How do you know that I knew my question was off topic ? As I stated, I am
new to pipes.

because you set followups to some other group. What, you can't be bothered
to read the answer here?
I just hope that a bunch of sanctimonious freaks like you can now leave me
in peace. Next time, even if I have an ANSI C related question, I will ask
someone offline or use Google.

Good idea.
 
J

Jack Klein

Please educate me, because I just don't see it. It seems to me that it makes
perfect sense, if you *must* cross-post, to set followups right at the
outset, in the very first article.

If the question is topical and proper here, the replies are as well.

Who is the OP to decide that readers of this group are entitled to
read his question, and perhaps to make a humble attempt at answering
it, but do not deserve the privilege of seeing the replies?

If a poster who reads this group only replies to such a question and
doesn't see the followup shenanigans, he will never see his own post
appear, let alone any followup or rebuttal to that post.

I see this as not much different from several other cases...

Multiple postings of the same messages to several related groups and
asking for email replies are usually offenses committed by newbies who
do not know any better.

Setting followups to the poster's email address, or using it to trim
off groups that were in the post itself indicates deliberate intent,
not newbie ignorance.

I can't be the only person who checks the back traffic looking for my
own posts, to see if there are any replies, rebuttals, or corrections
that I need to address. Had I replied without spotting the followup
trickery, I would not have ever seen my reply here, nor any responses
to it.

It just so happens that I was composing a polite redirection message
to a Linux newsgroup when I realized my newsreader was set to post to
a Linux group, one that I don't read.

I can well understand trimming on a reply, for example when someone
cross posts a C++ question to both comp.lang.c and comp.lang.c++. I
would have no problem with someone in comp.lang.c++ posting a reply to
that group only, and trimming comp.lang.c from the followup.

But what right has the OP to decide that he can hijack another group's
replies?
 
R

Richard Heathfield

Jack said:
If the question is topical and proper here, the replies are as well.

The question was about pipes. I imagine the question is topical in c.o.l.m -
and it was quite obvious from the tone of the original question that the OP
thought pipes were topical here in comp.lang.c too. The fact that he was
incorrect is neither here nor there for the moment. The point is that he
imagined that the question was topical in both groups.

Now, if we take as read that the OP believed the question to be topical in
both groups, what should he do about replies? Which is better? To have a
thread split across two groups, and getting more and more off-topic for
both? Or for the OP to set a simple followup to /one/ of the groups -
presumably the one the OP reads more often - so that those people from the
second group (in this case, clc) who wish to pursue the discussion can do
so easily by subscribing to colm, and those who don't, needn't bother.

Frankly, I think the latter is better. Your mileage obviously varies.
Who is the OP to decide that readers of this group are entitled to
read his question, and perhaps to make a humble attempt at answering
it, but do not deserve the privilege of seeing the replies?

If you want to see the replies, you need only check out the group to which
followups are set. If you don't wish to subscribe to the group just for one
thread, you can always use Google Groups.
If a poster who reads this group only replies to such a question and
doesn't see the followup shenanigans, he will never see his own post
appear, let alone any followup or rebuttal to that post.

Indeed. C'est la vie.

<snip>
 
M

Madhusudan Singh

To OP:
Jack's response was unfortunate, and as you can see, not many regulars
agree
with the tone, but they agree with part of it: Your question is not
topical in CLC as we discuss only the C language as described by the
ANSI/ISO standards. If you plan to subscribe regularly to CLC, you might
want to remove Jack from your killfile. To topical questions, he posts
erudite, correct answers and is a knowledgeable and respected contributor
here.
Before posting further questions, please do take the time to go through
the fine FAQ:
http://www.eskimo.com/~scs/C-faq/top.html

[Follow-up set to comp.lang.c and comp.os.linux.misc removed as this has
nothing to do with c.o.l.m.]

Thanks for clarifying that.

I have realized that Jack is one of the few with little patience for
mistakes by newcomers or maybe he just had had a bad day.

Anyways, I have hardly used any C/C++ in my life. I am vaguely familiar with
it (having written some rudimentary code way back in my undergrad), but my
language of choice is Fortran 90/95. I was only trying to port something
useful I found written in C over to Fortran using the IFC posix library and
ran up against the absence of popen().

I do not intend to subscribe to comp.lang.c because it is not my language of
work/choice and I cannot be 100 % certain if any of my future queries would
be topical to this NG. I have friends who are computer scientists (who tend
to be more familar with C/C++ than people like me) and I am sure they would
be more patient with a rookie.

Thanks for taking the time.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top