From: | Ian Lance Taylor <ian(at)airs(dot)com> |
---|---|
To: | ken(at)kencorey(dot)com |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: Re: Yikes! Bitten by line length? |
Date: | 2001-01-18 22:54:39 |
Message-ID: | sik87slbdc.fsf@daffy.airs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Ken Corey <ken(at)kencorey(dot)com> writes:
> Solaris' fgets function *only* returns the last part of a string if the
> string is over 256 bytes! The test was this little program:
>
> #include <stdio.h>
> int main(int argc,char **argv) {
> char line[1024];
> while((fgets(line,1024,stdin)) != EOF) {
> printf("Got '%s'\n",line);
> }
> }
>
> Enter in really big lines (> 256 characters), and you'll see what I
> mean.
I very much doubt it is the fgets function.
I suspect it is the terminal driver. The terminal driver only hands
data back to the application when it sees a newline. It probably only
holds 256 characters.
Try using an editor to create a file with a line longer than 256
characters, and run `test < file', to see whether it is fgets or the
terminal driver.
Ian
From | Date | Subject | |
---|---|---|---|
Next Message | Ken Corey | 2001-01-18 23:05:07 | Argh! What's a 'bpchar'? (copy/serial issues...I think) |
Previous Message | Laurel Williams | 2001-01-18 22:30:18 | Postgres superuser password issue--update |