At 5:31 PM +0000 12/13/02, Nigel Hall wrote:
In a browser HTML looks like this:

< H T M L > < H E A D > < m e t a h t t p - e q u i v = " C o n t e n t - T
y p e " c o n t e n t = " t e x t / h t m l ; c h a r s e t = I S O - 8 8 5
9 - 1 " >

In an editor it is one character per line, like this:



What does directory/full on the file show?  This has all the
characteristics of a classic porting problem where you are writing to
a record-oriented file with stream-oriented expectations.  fwrite()
or whatever will create a new record each time it's called, so if
it's called once for each character you get one character per line.

What to do about it depends on how the file is getting created.
Ideally, if you have control over how it's created, you can take
steps to make sure it is created with stream attributes.  If you are
appending to a file created by DCL (the shell), you might be able to
reopen it with some invocation similar to the following:

f = freopen(fname,"a",fp,"rat=cr","rfm=stmlf");

Another alternative is to buffer the write so nothing gets written
until a newline appears in the stream.

But the proper remedy depends on what the file attributes are and
where the file gets them from.

Craig A. Berry
mailto:craigberry mac com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]