comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Out_File , excess line
Date: Thu, 21 Jan 2016 08:38:52 -0500
Date: 2016-01-21T08:38:52-05:00	[thread overview]
Message-ID: <gak1abtmaj7739k95ka3brntcsf7jv9d8l@4ax.com> (raw)
In-Reply-To: 730fcd26-19e5-43e8-a071-5d2881d4a5bc@googlegroups.com

On Wed, 20 Jan 2016 20:50:23 -0800 (PST), comicfanzine@gmail.com declaimed
the following:

>AdaMagica ,
>
>I haven't created a file with Ada , but manually in a file manager .
>
>Then , i just opened it in Out_file with Ada , and then manually .
>
	On most OS, opening a file in an output only mode will result in
creating a new file, or at the least, wiping out whatever contents the file
used to have. So -- your "manual" creation outside of the program isn't
really a factor. On some, opening output only when the file already exists
may produce an error condition.

	And looking at the file in some text editor may be misleading. As has
been described, the Ada text file is somewhat record-oriented, with a
record ending (line terminator). Note the word: terminator -- not line
separator. (The standard doesn't define what the terminator is -- if the OS
supports records with a record-length field at the beginning, that is valid
for an implementation to use). Most likely, the system is using a line-feed
(or carriage return/line-feed pair in Windows) as the terminator.

	Most C/Unix influenced systems will treat a line-feed as a separator,
and a text editor will move the cursor to the beginning of the next line.
Only by dumping the file in hex can one see what is really contained.

	If I interpret the standard, it is possible that just opening and
closing a text file in Ada results in a file containing:

<lf><ff><eof>

Though I think most systems let <eof> get handled by the file system
directory information on the length of the file. Haven't really seen a
new-page code either.

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

  parent reply	other threads:[~2016-01-21 13:38 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  1:39 Out_File , excess line comicfanzine
2016-01-20 11:23 ` AdaMagica
2016-01-20 13:31 ` comicfanzine
2016-01-20 14:03 ` comicfanzine
2016-01-20 14:26   ` Dmitry A. Kazakov
2016-01-20 17:33   ` AdaMagica
2016-01-21  4:50 ` comicfanzine
2016-01-21 10:27   ` Jacob Sparre Andersen
2016-01-21 10:56     ` AdaMagica
2016-01-21 11:57       ` G.B.
2016-01-21 14:42         ` Dmitry A. Kazakov
2016-01-21 16:23           ` AdaMagica
2016-01-22  2:50             ` Dennis Lee Bieber
2016-01-21 13:38   ` Dennis Lee Bieber [this message]
2016-01-21 17:30 ` comicfanzine
2016-01-22  1:56   ` comicfanzine
2016-01-22 12:28   ` Brian Drummond
2016-01-22 20:01 ` comicfanzine
2016-01-23 20:06 ` comicfanzine
2016-01-27  9:26   ` Simon Wright
2016-01-27 19:32     ` Simon Wright
2016-01-27 21:31       ` Jeffrey R. Carter
2016-01-27 20:28     ` Dmitry A. Kazakov
2016-01-24 16:11 ` comicfanzine
2016-01-25 21:54 ` comicfanzine
2016-01-25 22:01   ` MM
2016-01-26  0:50     ` comicfanzine
2016-01-26 10:10 ` comicfanzine
2016-01-27  3:57 ` comicfanzine
2016-01-27  8:13   ` AdaMagica
2016-01-28  4:35 ` comicfanzine
2016-01-29 23:04 ` comicfanzine
2016-01-30  9:44 ` Simon Wright
2016-01-30 10:43   ` AdaMagica
2016-01-30 13:51     ` Simon Wright
2016-01-31  8:56 ` comicfanzine
2016-01-31 11:25   ` Simon Wright
2016-01-31 12:57     ` Dmitry A. Kazakov
2016-01-31 17:00       ` Simon Wright
2016-01-31 11:51   ` AdaMagica
2016-02-01  6:22 ` comicfanzine
2016-02-01  8:32   ` Dmitry A. Kazakov
2016-02-09 15:07 ` comicfanzine
2016-02-09 17:00   ` Dmitry A. Kazakov
replies disabled

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