473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

buffering of stdio streams

[hopefully of wide interest, and not too OT]

Under Linux, I'm using select() to detect when any of a collection of
socket descriptors is ready for reading. Associated with each socket
descriptor is a FILE pointer, obtained via fdopen(sd, "r"). When any
socket descriptor becomes ready, I call fgets(...., fp) to read a line
of textual input.

However, I suspect that if more than one line of input is ready on the
socket descriptor, that fgets() reads it all in and places it in the
stdio buffer associated with the FILE pointer. Thus, I'm not able to
tell when the "2nd" line of input arrives, because the socket descriptor
is not ready, and the 2nd line has already arrived, and is sitting in
the FILE's buffer.

How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?

Thanks,

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #1
30 2105
On Fri, 6 Aug 2004 04:40:16 +0000 (UTC), Chris McDonald
<ch***@csse.uwa.edu.au> wrote in comp.lang.c:
[hopefully of wide interest, and not too OT]

Under Linux, I'm using select() to detect when any of a collection of
socket descriptors is ready for reading. Associated with each socket
descriptor is a FILE pointer, obtained via fdopen(sd, "r"). When any
socket descriptor becomes ready, I call fgets(...., fp) to read a line
of textual input.

However, I suspect that if more than one line of input is ready on the
socket descriptor, that fgets() reads it all in and places it in the
stdio buffer associated with the FILE pointer. Thus, I'm not able to
tell when the "2nd" line of input arrives, because the socket descriptor
is not ready, and the 2nd line has already arrived, and is sitting in
the FILE's buffer.

How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?

Thanks,


You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #2
Jack Klein <ja*******@spamcop.net> writes:
On Fri, 6 Aug 2004 04:40:16 +0000 (UTC), Chris McDonald
[hopefully of wide interest, and not too OT]

.....
You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.


A tiresome response.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #3
Chris McDonald wrote:
Jack Klein <ja*******@spamcop.net> writes:

On Fri, 6 Aug 2004 04:40:16 +0000 (UTC), Chris McDonald
[hopefully of wide interest, and not too OT]

.....


You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.

A tiresome response.


Yes, but these tiresome off-topic questions posted by people with no
sense of proper behavior in newsgroups evoke such completely correct
responses. How does someone get a doctorate without getting a clue? By
going to school in Australia.
Nov 14 '05 #4
Chris McDonald <ch***@csse.uwa.edu.au> wrote:
[hopefully of wide interest, and not too OT]

Under Linux, I'm using select()
This _is_ off-topic.
How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?


This _is_ off-topic.

And you'd have known this, had you but had the common decency to browse
the FAQ before posting, as any civilised Usenetter does.

<http://www.eskimo.com/~scs/C-faq/q19.2.html>. HTH; HAND.

Richard
Nov 14 '05 #5
Chris McDonald wrote:
Jack Klein <ja*******@spamcop.net> writes:
On Fri, 6 Aug 2004 04:40:16 +0000 (UTC), Chris McDonald

[hopefully of wide interest, and not too OT]
.....

You need news:comp.os.linux.development.apps. Neither select()
nor fdopen() are part of the C language, they are non-standard
extensions provided by your platform.


A tiresome response.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089


Interesting. An allegedly educated in the field individual is
incapable of preparing correct signatures with a proper sig
marker, is incapable of checking the usual practices on a
newsgroup before butting in with off-topic material, and then
responds to polite and helpful advice about where to get
appropriate information with a snippy answer.

This all speaks very poorly of one or more of the McDonald clan,
The University of Western Australia (and its department of
Computer Science), Australians, or Western Australians. I am not
sure whether manners or education are at fault. At any rate the
so-called Doctor is definitely in the boor category.

Somehow I doubt that all Australians should be so categorized.
Maybe some will respond and better place the category limit?

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski
Nov 14 '05 #6
Martin Ambuhl <ma*****@earthlink.net> writes:
Yes, but these tiresome off-topic questions posted by people with no
sense of proper behavior in newsgroups evoke such completely correct
responses. How does someone get a doctorate without getting a clue? By
going to school in Australia.


A tiresome ad hominem response.
Good luck with your doctorate.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #7
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
Chris McDonald <ch***@csse.uwa.edu.au> wrote:
[hopefully of wide interest, and not too OT]

Under Linux, I'm using select()

This _is_ off-topic.
Yes, I _knew_ it was off-topic, and even stated this in my article.
Your point is?

And you'd have known this, had you but had the common decency to browse
the FAQ before posting, as any civilised Usenetter does. <http://www.eskimo.com/~scs/C-faq/q19.2.html>. HTH; HAND.


Thank you for this helpful response.
Nov 14 '05 #8
CBFalconer <cb********@yahoo.com> writes:
Interesting. An allegedly educated in the field individual is
incapable of preparing correct signatures with a proper sig
marker, is incapable of checking the usual practices on a
newsgroup before butting in with off-topic material, and then
responds to polite and helpful advice about where to get
appropriate information with a snippy answer. This all speaks very poorly of one or more of the McDonald clan,
The University of Western Australia (and its department of
Computer Science), Australians, or Western Australians. I am not
sure whether manners or education are at fault. At any rate the
so-called Doctor is definitely in the boor category. Somehow I doubt that all Australians should be so categorized.
Maybe some will respond and better place the category limit?

Your post is off-topic, but that's OK if you're in the net police, isn't it?
Another tiresome ad hominem response.
Axis of the killing, and now a free trade agreement - why do we bother?
Yeah, yeah, we know, don't waste your precious bandwidth.
Nov 14 '05 #9
Chris McDonald <ch***@csse.uwa.edu.au> wrote:
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
Chris McDonald <ch***@csse.uwa.edu.au> wrote:

[hopefully of wide interest, and not too OT]

Under Linux, I'm using select()
This _is_ off-topic.


Yes, I _knew_ it was off-topic, and even stated this in my article.
Your point is?


My point is that if you'd had half a brain, or even the civility
expected of normal humans, you would have known better than to post this
here, where it is _off_ _topic_. Of course, that would have cost you all
of, oh, perhaps three minutes searching for a newsgroup where it is
on-topic, but your time is, clearly, much more important than that of
the readers of this newsgroup. Pity, then, that you've probably already
spent more time posting holier-than-thou, self-important snide responses
than you would have if you'd been a decent netizen in the first place.

But then, what else could we expect from a descendant of criminal
exiles, and a sandgroper to boot?
And you'd have known this, had you but had the common decency to browse
the FAQ before posting, as any civilised Usenetter does.

<http://www.eskimo.com/~scs/C-faq/q19.2.html>. HTH; HAND.


Thank you for this helpful response.


I hope it taught you something. Apparently, nothing else has.

Richard
Nov 14 '05 #10
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
My point is that if you'd had half a brain, or even the civility
expected of normal humans, you would have known better than to post this
here, where it is _off_ _topic_. Of course, that would have cost you all
of, oh, perhaps three minutes searching for a newsgroup where it is
on-topic, but your time is, clearly, much more important than that of
the readers of this newsgroup. Pity, then, that you've probably already
spent more time posting holier-than-thou, self-important snide responses
than you would have if you'd been a decent netizen in the first place.
The pot calling the kettle black.
How does one apply for membership to your precious net-police squad?

It's a newsgroup guys, get over it.
It's a medium for exchange and education.

Oh, quick, there was a post about free iPods.
You guys better get over there and shoot 'em down quick.

But then, what else could we expect from a descendant of criminal
exiles, and a sandgroper to boot?


There you go again, tiresome.
It must be a Friday thing, and you all have nothing better to do.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #11
Chris McDonald wrote:

Your post is off-topic, but that's OK if you're in the net police, isn't it?
You are dead wrong. Please get your lazy butt over to
news:news.announce.newusers and learn something? Topicality is topical.
Another tiresome ad hominem response.


Accusing people of ad hominem responses does not make your complete lack
of newgroup etiquette go away. Your labelling as tiresome completely
correct and proper responses to your completely wrong and improper
postings only labels you as a tiresome idiot. You will have to gain
some humanity before you qualify for an ad hominem attack. Does your
university know that you are embarrassing them by claiming to have been
awarded a degree?
Nov 14 '05 #12
Chris McDonald wrote:
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:

Chris McDonald <ch***@csse.uwa.edu.au> wrote:


[hopefully of wide interest, and not too OT]

Under Linux, I'm using select()


This _is_ off-topic.

Yes, I _knew_ it was off-topic, and even stated this in my article.
Your point is?


Then why the hell did you post it? Is your doctorate in trolling?
Nov 14 '05 #13
In article <ce**********@enyo.uwa.edu.au>,
Chris McDonald <ch***@csse.uwa.edu.au> wrote:
How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?


You can't, portably.

Unportably, the answer is likely to be obvious from the definition of
getc in stdio.h: typically it will be a macro that does something very
simple if there are still characters in the buffer, and otherwise
calls a function.

-- Richard
Nov 14 '05 #14
Chris McDonald wrote:

Martin Ambuhl <ma*****@earthlink.net> writes:
Yes, but these tiresome off-topic questions posted by people with no
sense of proper behavior in newsgroups evoke such completely correct
responses. How does someone get a doctorate without getting a clue? By
going to school in Australia.


A tiresome ad hominem response.
Good luck with your doctorate.

Oh, another of one of these idjits.
*plonk*


Brian Rodenborn
Nov 14 '05 #15
Martin Ambuhl wrote:
Then why the hell did you post it? Is your doctorate in trolling?


Don't waste time with the guy, it's obvious he's a troll looking for
attention. Plonk him and move on.


Brian Rodenborn
Nov 14 '05 #16
Chris McDonald wrote:

Jack Klein <ja*******@spamcop.net> writes:

You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.


A tiresome response.

But correct.

Brian Rodenborn
Nov 14 '05 #17
Martin Ambuhl wrote:
Chris McDonald wrote:
Your post is off-topic, but that's OK if you're in the net
police, isn't it?


You are dead wrong. Please get your lazy butt over to
news:news.announce.newusers and learn something? Topicality
is topical.
Another tiresome ad hominem response.


Accusing people of ad hominem responses does not make your
complete lack of newgroup etiquette go away. Your labelling
as tiresome completely correct and proper responses to your
completely wrong and improper postings only labels you as a
tiresome idiot. You will have to gain some humanity before
you qualify for an ad hominem attack. Does your university
know that you are embarrassing them by claiming to have been
awarded a degree?


They should now. I complained to his abuse header address about 6
hours ago.

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski
Nov 14 '05 #18

In article <ce**********@enyo.uwa.edu.au>, Chris McDonald <ch***@csse.uwa.edu.au> writes:
[hopefully of wide interest, and not too OT]
Well, I for one appreciate the topicality warning.
[in c.l.c terms: I am using stream I/O in an implementation-defined
way]

However, I suspect that if more than one line of input is ready on the
socket descriptor, that fgets() reads it all in and places it in the
stdio buffer associated with the FILE pointer.
Quite possible.
Thus, I'm not able to
tell when the "2nd" line of input arrives, because the socket descriptor
is not ready, and the 2nd line has already arrived, and is sitting in
the FILE's buffer.
Quite possible. There's no standard way to change input buffering
for streams, so there isn't anything you can do about this. (OT:
Even if there were, you wouldn't want to, because the only way to
implement it would be to have the stream read one byte at a time from
the socket, which would be very inefficient.)
How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?


You can't, within the standard library, unless I'm missing something.
Depending on implementation behavior, you might be able to reliably
get a positive answer with fgetc / ungetc - get a character, showing
there's something in the buffer, and then push it back - but that
won't work if the buffer is empty, since it will cause the stream to
try to read from the source.

OT: I mooted this idea - attaching a stream to a socket - in
comp.protocols.tcp-ip some years ago, and Barry Margolin was quick
to point out a reason or two why it was a bad one (clever though it
might seem on first inspection). You might want to check the Google
archives for that exchange.

Ultimately, I think you're faced with either writing your own code or
finding someone else's implementation to take the obvious approach:
maintain your own buffer, and when you want to check if more data is
ready, check it first, then check the socket if the buffer is empty.

--
Michael Wojcik mi************@microfocus.com

This year's runner-up in the All-Usenet Creative Use Of English In A
Quasi-Legal But Probably Completely Ineffectual Signature Statement:

Disclaimer : I am a free denizen of this world and statements are of mine
and solly mine. Nobody dare sue me as you may end up even loosing your
attorney fees. -- Sridhar (ho********@hotmail.com)
Nov 14 '05 #19
# Under Linux, I'm using select() to detect when any of a collection of
# socket descriptors is ready for reading. Associated with each socket
# descriptor is a FILE pointer, obtained via fdopen(sd, "r"). When any
# socket descriptor becomes ready, I call fgets(...., fp) to read a line
# of textual input.

stdio doesn't handle more sophisticated I/O all that well. Rather than
struggle to make it work, I abandon it in favour of lower level
interfaces, like read() and write(), or more sophisticated libraries
like Tcl_Write and Tcl_Gets.

# However, I suspect that if more than one line of input is ready on the
# socket descriptor, that fgets() reads it all in and places it in the
# stdio buffer associated with the FILE pointer. Thus, I'm not able to
# tell when the "2nd" line of input arrives, because the socket descriptor
# is not ready, and the 2nd line has already arrived, and is sitting in
# the FILE's buffer.

Tcl_Gets works well with non-blocking bufferred reads. You can use the
Tcl C API without using a Tcl interpretter if you want.

Remember the ANS C is driven by greatest common factor politics. Only
those features all corporate sponsors can implement get included.
There's a whole bunch of free library available on nearly every machine,
and which is not shackled to ANSI sponsors.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Wow. A sailboat.
Nov 14 '05 #20
Jack Klein wrote:
[... Linux / fdopen() / select() / fgets() ...]
How can I tell if anything resides in the FILE's buffer, without
performing another blocking fgets() ?

Thanks,


You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.


True. However, they are irrelevent to the actual question being asked,
which boils down to his last sentence:

"How can I tell if anything resides in the FILE's buffer?"

The answer to that, AFAIK, is "you can't, without getting system-specific".
Make a function, let's call it "GetFileUnreadBufferCount(FILE *f)", which
will return the number of unread bytes in the FILE's buffer. Isolate it
in a system-specific module, to make porting easier.

Then, you can make system-specific versions of this function. Check with
your compiler vendors documentation, newsgroup, or support, to find out
if there is a way to do this with your specific compiler.

(Hint: check the FILE structure definition. It's probably hidden in there.)

Note, however, that even this, by itself, won't help you if there is a
partial line in the buffer, as fgets() will still block unless the rest
of the line is on the stream, but not yet read into the buffer.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+

Nov 14 '05 #21
SM Ryan wrote:

# Under Linux, I'm using select() to detect when any of a collection of
# socket descriptors is ready for reading. Associated with each socket
# descriptor is a FILE pointer, obtained via fdopen(sd, "r"). When any
# socket descriptor becomes ready, I call fgets(...., fp) to read a line
# of textual input.

stdio doesn't handle more sophisticated I/O all that well. Rather than
struggle to make it work, I abandon it in favour of lower level
interfaces, like read() and write(), or more sophisticated libraries
like Tcl_Write and Tcl_Gets.


Please do not answer off-topic questions here in c.l.c. There is
(at least in theory) noone to validate and/or criticize your
replies, if they are wrong, and it only encourages people to ask
such. In addition, answers specifying such non standard things as
sockets, fdopen etc. are also off-topic. However rerouting to a
suitable newsgroup is always useful.

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski
Nov 14 '05 #22
On Fri, 6 Aug 2004 08:18:50 +0000 (UTC), Chris McDonald
<ch***@csse.uwa.edu.au> wrote:
Oh, quick, there was a post about free iPods.
You guys better get over there and shoot 'em down quick.


That post was spam, and has already been reported as such.

So far, they haven't replied to insist that we should read and reply
to it.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #23
Thank you to the people who kindly posted replies to my question -
in particular those highlighting that what I was trying to do was not
possible in a portable fashion.

My apologies for trying to better set the scene, and daring to use
the words Linux, socket, select(), or fdopen(), when my question only
pertained to the exact topic that I chose for my Subject: line.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #24
Kenneth Brody wrote:
.... snip ...
True. However, they are irrelevent to the actual question being
asked, which boils down to his last sentence:

"How can I tell if anything resides in the FILE's buffer?"

The answer to that, AFAIK, is "you can't, without getting system-
specific". Make a function, let's call it "GetFileUnreadBufferCount(
FILE *f)", which will return the number of unread bytes in the
FILE's buffer. Isolate it in a system-specific module, to make
porting easier.

Then, you can make system-specific versions of this function.
Check with your compiler vendors documentation, newsgroup, or
support, to find out if there is a way to do this with your
specific compiler.

(Hint: check the FILE structure definition. It's probably hidden
in there.)

Note, however, that even this, by itself, won't help you if there
is a partial line in the buffer, as fgets() will still block unless
the rest of the line is on the stream, but not yet read into the
buffer.


Again, this illustrates the dangers of answering OT questions.
For many systems, there is no internal buffer. Whether or not it
exists, the hardware may have a character (or mre) ready in such
things as UART FIFO buffers. The fact that a putative i/o buffer
is empty does not mean that there is nothing in the input stream.
Once more, the _only_ appropriate answer is to redirect to the
appropriate system specific newsgroup. Even if he specifies his
system, and you are familiar with it, he should still be
redirected so that knowledgeable people can vet any answers.

BTW, only somebody very knowledgeable should be poking about in
system headers and macros. If he is that knowledgeable, he
wouldn't be asking the question in the first place.

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski
Nov 14 '05 #25
On Fri, 6 Aug 2004 06:29:04 +0000 (UTC), Chris McDonald
<ch***@csse.uwa.edu.au> wrote in comp.lang.c:
Jack Klein <ja*******@spamcop.net> writes:
On Fri, 6 Aug 2004 04:40:16 +0000 (UTC), Chris McDonald
[hopefully of wide interest, and not too OT]

.....

You need news:comp.os.linux.development.apps. Neither select() nor
fdopen() are part of the C language, they are non-standard extensions
provided by your platform.


A tiresome response.


Yes, yours is.

*plonk*

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #26
Chris McDonald wrote:

Thank you to the people who kindly posted replies to my question -
in particular those highlighting that what I was trying to do was not
possible in a portable fashion.

My apologies for trying to better set the scene, and daring to use
the words Linux, socket, select(), or fdopen(), when my question only
pertained to the exact topic that I chose for my Subject: line.


No, your problem is taking a snide and antagonistic attitude to
those who politely pointed you to suitable newsgroups and advised
you that you were off topic here. If your objective was to leave
a smelly reputation, you have succeeded.

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski
Nov 14 '05 #27
Mac
On Fri, 06 Aug 2004 07:02:08 +0000, CBFalconer wrote:

[snip]
__________________________________________________ _____________________________ Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W:
http://www.csse.uwa.edu.au/~chris The University of Western Australia,
M002 T: +618 6488 2533 Crawley, Western Australia, 6009 F:
+618 6488 1089


Interesting. An allegedly educated in the field individual is incapable
of preparing correct signatures with a proper sig marker, is incapable
of checking the usual practices on a newsgroup before butting in with
off-topic material, and then responds to polite and helpful advice about
where to get appropriate information with a snippy answer.

This all speaks very poorly of one or more of the McDonald clan, The
University of Western Australia (and its department of Computer
Science), Australians, or Western Australians. I am not sure whether
manners or education are at fault. At any rate the so-called Doctor is
definitely in the boor category.

Somehow I doubt that all Australians should be so categorized. Maybe
some will respond and better place the category limit?

Well, I'm not an Australian, or a MacDonald (nor McDonald), but I
don't think you should judge any of these superficial groups (did you
every read _Cat's Cradle_? The groups you mention are all granfalloons
;-) by the behavior of this one individual. I have personally met a fair
number of Australians, and found nothing to complain about. The people I
met were informal, friendly, helpful, and had a real can-do attitude.

As for the clan MacDonald, well, the days of clans are long gone, for all
intents and purposes. The idea that all members of the clan MacDonald
share traits in common is just silly. I think we just have one individual
here who has made a series of errors and will hopefully either conform to
the applicable rules of netiquette or just go away.

--Mac

Nov 14 '05 #28
CBFalconer <cb********@yahoo.com> writes:
Chris McDonald wrote:
.....

My apologies for trying to better set the scene, and daring to use
the words Linux, socket, select(), or fdopen(), when my question only
pertained to the exact topic that I chose for my Subject: line.
No, your problem is taking a snide and antagonistic attitude to
those who politely pointed you to suitable newsgroups and advised
you that you were off topic here. If your objective was to leave
a smelly reputation, you have succeeded.

Without continuing the muckraking, my concern is that my serious and
sensible question was immediately treated as if it was asked by someone
having no clue. As with many quite reasonable questions asked by other
individuals seeking help via this newsgroup, a number of keywords in
a question, like a red flag to a bull, trigger an immediate response
directing the question to another newsgroup.

Many of us who seek help via this newsgroup, are tired of these polite,
yet trite, responses. Like discussions in most other less technical
newsgroups, any comment on our dissatisfaction with these responses
quickly degenerates into character attack or, for some reason, on a whole
country, state, university, or a person's long standing qualifications.
It appears that all is fair game.

I asked a question about the behaviour of the buffering of stdio
streams. I tried to set the scene as to how my data arrived in the buffer.
Anyone making a resonable effort to comprehend my question, saw that the
issue was independent of operating systems and other off-topic areas.
At least 2 responders did not find the question off-topic.

We all agree that the FAQ is very good, meeting many needs. However, it
doesn't hold an answer to my question - certainly not one I could find.
All that says is that my question is not Frequently Asked. And yet
the response of one individual was instantly that I should lurk long in
this newsgroup, read the FAQ, and go back to news.admin.newbies. Well,
I had read the FAQ (section 12 on stdio anyway, and Phil Plauger's "The
Standard C Library"), I've been reading USENet since 1984, and c.l.c.,
for as long as my University has been receiving it.

Few (unfortunately) will have followed this thread to its end (I hope),
but the hundreds of us legitimate legitimate that have serious, relevant
questions to ask, would appreciate not being continually shot down by
the handful of individuals that treat this shared newsgroup as their own.

I welcome any serious discussion; just leave my country, state,
university, and education out of it.

__________________________________________________ _____________________________
Dr Chris McDonald E: ch***@csse.uwa.edu.au
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
Nov 14 '05 #29
Chris McDonald <ch***@csse.uwa.edu.au> wrote:
# CBFalconer <cb********@yahoo.com> writes:
#
# >Chris McDonald wrote:
# >> .....
# >>
# >> My apologies for trying to better set the scene, and daring to use
# >> the words Linux, socket, select(), or fdopen(), when my question only
# >> pertained to the exact topic that I chose for my Subject: line.
#
# >No, your problem is taking a snide and antagonistic attitude to
# >those who politely pointed you to suitable newsgroups and advised
# >you that you were off topic here. If your objective was to leave
# >a smelly reputation, you have succeeded.

'Assholes do vex me.'
- Robin Williams

# Without continuing the muckraking, my concern is that my serious and
# sensible question was immediately treated as if it was asked by someone
# having no clue. As with many quite reasonable questions asked by other
# individuals seeking help via this newsgroup, a number of keywords in
# a question, like a red flag to a bull, trigger an immediate response
# directing the question to another newsgroup.

You're dealing with an obnoxious clique which tries like hell to moderate
an unmoderated newsgroup. This way they can post their off topic messages
unimpeded. Contrary to their insistence, this is group is not strictly
about ANS C; this whinging about off-topic posts started about seven years
ago and destroyed a previously valuable resource about C programming.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Leave it to the Catholics to destroy existence.
Nov 14 '05 #30
CBFalconer wrote:
SM Ryan wrote:
# Under Linux, I'm using select() to detect when any of a collection of
# socket descriptors is ready for reading. Associated with each socket
# descriptor is a FILE pointer, obtained via fdopen(sd, "r"). When any
# socket descriptor becomes ready, I call fgets(...., fp) to read a line
# of textual input.

stdio doesn't handle more sophisticated I/O all that well. Rather than
struggle to make it work, I abandon it in favour of lower level
interfaces, like read() and write(), or more sophisticated libraries
like Tcl_Write and Tcl_Gets.

Please do not answer off-topic questions here in c.l.c. There is
(at least in theory) noone to validate and/or criticize your
replies, if they are wrong, and it only encourages people to ask
such. In addition, answers specifying such non standard things as
sockets, fdopen etc. are also off-topic. However rerouting to a
suitable newsgroup is always useful.


So is remembering to take your medication.

Dave
Nov 14 '05 #31

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tim Mohler | last post by:
All - I have a script that provides a web page interface to various system utilities. Once the user has selected the utility and input various parameters, it calls itself with a different method...
3
by: Alex Glass | last post by:
I have read plenty about applying double buffering for animation and self drawn forms. Is there a way to apply it to a form with many standard controls on it (textboxes, labels etc) ?? I have...
7
by: Mathias Herrmann | last post by:
Hi. I have the following problem: Using popen() to execute a program and read its stdout works usually fine. Now I try to do this with a program called xsupplicant (maybe one knows), but I dont...
2
by: Jason | last post by:
I have created a 2d isometric game map using tiles and now I'm trying to move around my map..when i go near the edge of the map I want to redraw the map to show new parts of the map however the...
4
by: Manfred Braun | last post by:
Hi All ! I think, there is a bug in the System.Console class related to use the STDIO streams. I am doing a very simple thing in a console-based program named CS Console.In.Peek(); and...
3
by: ssoffline | last post by:
hi i have an app in which i can drop objects onto a form and move them, it consists of graphics (lines), i am using double buffering to avoid filckering in the parent control which is a panel,but...
18
by: sam_cit | last post by:
Hi Everyone, int main() { printf("not included stdio.h"); } Yes, i haven't included stdio.h and my compiler would generate a warning and would assume that it would return a int, my question...
1
by: sven _ | last post by:
Keywords: subprocess stdout stderr unbuffered pty tty pexpect flush setvbuf I'm trying to find a solution to <URL:http://bugs.python.org/issue1241>. In short: unless specifically told not to,...
4
by: Grant Edwards | last post by:
When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. From...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.