comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Creating an empty file with Ada.Text_IO
Date: Mon, 24 Aug 2015 20:06:54 -0400
Date: 2015-08-24T20:06:54-04:00	[thread overview]
Message-ID: <84cntalfhijjvepn1qq1ha6456k08sf2vf@4ax.com> (raw)
In-Reply-To: b6ab40d4-f3fd-4a16-9ea4-c64397247214@googlegroups.com

On Mon, 24 Aug 2015 07:16:45 -0700 (PDT), Maciej Sobczak
<see.my.homepage@gmail.com> declaimed the following:

>
>The program creates a file, but before the file is closed, a newline character(s) is written to it. It is, physically, not empty.
>Similarly, if a non-terminated line is written (by means of Ada.Text_IO.Put), it is automatically terminated by a newline.
>
	And that IS the documented standard... Actually, you are lucky that the
new-line is all you see, as the standard would have the Close operation
ensure the file ends with: new-line, new-page, end-of-file (but does not
mandate how those states are represented in the file -- suspect EOF is
mostly handled as meta-data in the directory entry rather than an explicit
character)

>I understand that the intent of the Ada.Text_IO package was to provide a line-oriented file I/O, but it is sometimes getting in the way.
>What are the recommended ways of:
>a) creating empty files
>b) writing a non-terminated line to (or generally at the end of) the file
>
>?

	As has been mentioned, Stream_IO was sort of created for this role.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

      parent reply	other threads:[~2015-08-25  0:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 14:16 Creating an empty file with Ada.Text_IO Maciej Sobczak
2015-08-24 16:15 ` Dmitry A. Kazakov
2015-08-25  8:20   ` Maciej Sobczak
2015-08-25 15:26     ` Maciej Sobczak
2015-08-25 16:18       ` J-P. Rosen
2015-08-25 16:45       ` G.B.
2015-08-24 18:51 ` AdaMagica
2015-08-24 22:22   ` Randy Brukardt
2015-08-25  0:06 ` Dennis Lee Bieber [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox