Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: advance=no ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 46 Topic 8227 of 8767
Post > Topic >>

Re: advance=no problem

by glen herrmannsfeldt <gah@[EMAIL PROTECTED] > May 12, 2008 at 01:09 PM

Janne Blomqvist wrote:
> On 2008-05-12, glen herrmannsfeldt <gah@[EMAIL PROTECTED]
> wrote:

>>The C/unix tradition is that terminal output (either stderr, or
>>stdout not redirected to a file) is unbuffered.  The output will
>>appear immediately without the need for fflush().  When going
>>to a file or even a pipe it is buffered and normally doesn't appear
>>immediately.

> From the latest(?) ISO C draft (n1256.pdf), page 267:

> At program startup, three text streams are predefined and need not be
> opened explicitly - standard input (for reading conventional input),
> standard output (for writing conventional output), and standard error
> (for writing diagnostic output). As initially opened, the standard
> error stream is not fully buffered; the standard input and standard
> output streams are fully buffered if and only if the stream can be
> determined not to refer to an interactive device.

> Additionally, C has the concept of "line buffered", meaning that the
> buffer is flushed when a newline is written. AFAIK stdout and stdin,
> when connected to a terminal (as they usually are unless they have
> been redirected), are typically line buffered, whereas stderr is
> unbuffered.

I wrote C/unix, as it is a little hard to determine which
parts are C related and which unix.  A C implementation on
a system with line buffered terminals would have a hard time
following that rule.  Also, the C rules are meant to allow
for record oriented file systems like some IBM descendants
of OS/360 use.

>>I believe there is some historical connection between
>>ADVANCE="NO" and C stream output.  I am pretty sure the
>>Fortran standard doesn't require unbuffered (in the unix
>>sense) output, but it might be considered
>>a "quality of implementation" issue.

> Well, C has no concept of records, so advance='no' doesn't
> really fit into that model.

The comments about "line buffering" are, I believe, meant to
allow for systems that do use records.  (For text files.)
C defaults to text mode, using "binary mode" when a "b"
is included in the fopen() call.

 > However, access='stream' is quite close to the C
> model (though for formatted I/O the distinction between sequential and
> stream goes into somewhat arcane details), and advance='no' provides a
> way to suppress the trailing newline after a read/write statement.

Maybe the OP should try access="stream".

-- glen
 




 46 Posts in Topic:
advance=no problem
rudra <bnrj.rudra@[EMA  2008-05-12 06:22:39 
Re: advance=no problem
rudra <bnrj.rudra@[EMA  2008-05-12 06:40:16 
Re: advance=no problem
Gordon Sande <g.sande@  2008-05-12 13:50:13 
Re: advance=no problem
harper@[EMAIL PROTECTED]   2008-05-13 11:47:46 
Re: advance=no problem
tholen@[EMAIL PROTECTED]   2008-05-12 19:26:06 
Re: advance=no problem
glen herrmannsfeldt <g  2008-05-12 11:43:13 
Re: advance=no problem
tholen@[EMAIL PROTECTED]   2008-05-12 20:12:12 
Re: advance=no problem
Janne Blomqvist <foo@[  2008-05-12 23:32:04 
Re: advance=no problem
glen herrmannsfeldt <g  2008-05-12 13:09:41 
Re: advance=no problem
Janne Blomqvist <foo@[  2008-05-13 00:48:07 
Re: advance=no problem
"James Giles" &  2008-05-12 20:32:24 
Re: advance=no problem
Janne Blomqvist <foo@[  2008-05-12 23:55:24 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-12 16:31:12 
Re: advance=no problem
glen herrmannsfeldt <g  2008-05-12 15:47:07 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-13 00:42:30 
Re: advance=no problem
GaryScott <garylscott@  2008-05-13 07:21:14 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-13 08:57:42 
Re: advance=no problem
GaryScott <garylscott@  2008-05-13 09:46:51 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-13 15:59:48 
Re: advance=no problem
"James Giles" &  2008-05-13 23:10:25 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-13 17:05:52 
Re: advance=no problem
"James Giles" &  2008-05-14 00:38:23 
Re: advance=no problem
"James Giles" &  2008-05-14 00:57:05 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-13 18:33:40 
Re: advance=no problem
"James Giles" &  2008-05-14 02:48:43 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-13 20:05:16 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-13 20:45:00 
Re: advance=no problem
Steve Lionel <Steve.Li  2008-05-14 10:07:48 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-13 23:36:34 
Re: advance=no problem
"Jugoslav Dujic"  2008-05-14 09:11:21 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-14 00:39:12 
Re: advance=no problem
GaryScott <garylscott@  2008-05-14 07:18:32 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-14 07:47:59 
Re: advance=no problem
Ron Shepard <ron-shepa  2008-05-14 10:11:23 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-14 12:12:11 
Re: advance=no problem
glen herrmannsfeldt <g  2008-05-14 13:01:00 
Re: advance=no problem
glen herrmannsfeldt <g  2008-05-14 11:09:33 
Re: advance=no problem
GaryScott <garylscott@  2008-05-14 08:22:03 
Re: advance=no problem
"James Giles" &  2008-05-14 18:41:44 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-14 12:12:11 
Re: advance=no problem
Gary Scott <garylscott  2008-05-14 20:59:30 
Re: advance=no problem
"James Giles" &  2008-05-15 02:30:21 
Re: advance=no problem
nospam@[EMAIL PROTECTED]   2008-05-14 20:44:10 
Re: advance=no problem
robert.corbett@[EMAIL PRO  2008-05-14 23:19:22 
Re: advance=no problem
dongyuanxun <dongyuanx  2008-05-15 01:11:12 
Re: advance=no problem
GaryScott <garylscott@  2008-05-15 07:00:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 13:02:08 CDT 2008.