Getting a string from a file or socket

Joachim Ziegler <[email protected]>
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
I am missing a function like

   char *fgets(char *s, int size, FILE *stream);

in NSPR, which reads characters from a file or socket and stops when it
encounters an EOF or newline, storing the characters read in a 0-byte
terminated buffer. This is a very common task in server programming. I
do not want do (re-)implement it.

Any ideas? Shouldn't such a basic operation included in the library? As
far as I can see, NSPR only offers the very basic PR_Read().

Joachim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.