comp.lang.ada
 help / color / mirror / Atom feed
From: Thierry Lelegard <thierry.lelegard@canal-plus.fr>
Subject: Re: Reading variable-length records from a file
Date: Mon, 13 Aug 2001 10:14:38 +0200
Date: 2001-08-13T10:14:38+02:00	[thread overview]
Message-ID: <3B778C6E.9B43450D@canal-plus.fr> (raw)
In-Reply-To: 9l19l4$45m$1@slb7.atl.mindspring.net

> What is the best method for reading variable-length records from a file, using Ada (generic Ada, or GNAT)?  I have some files, from
> a VMS system, that I want to read on a Win2K system.  The files have the VMS standard "implied carriage control", which means that
> each "record" (or line; it's a text file) has a two-byte count value, followed by "count" bytes (characters).

How do you move the file from VMS to Windows?

If you use FTP, simply specify "ASCII mode" instead of "IMAGE mode"
during the transfer and you will get a plain Windows text file.

If you share the file system (NFS, Samba), make sure that the file 
is created with the "stream" or "stream_lf" attribute (use FDL options).

Otherwise, if you can't modify the way the file is created, you can
convert it on VMS using the following DCL procedure. This changes
the physical content while preserving the logical one. After conversion,
the file remains a valid text file on VMS but is also Windows-compliant.

$ convert/fdl=sys$input: 'infile' 'outfile'
        file
          organization sequential
        record
          block_span yes
          carriage_control carriage_return
          format stream
$

We work in an heterogeneous environment (VMS + UNIX + Windows) and
we share all Ada source files (text files) on the same file system
without problem.

-Thierry
____________________________________________________________________________

Thierry Lelegard, "The Jazzing Troll", Email: thierry.lelegard@canal-plus.fr
CANAL+ Technologies, 34 place Raoul Dautry, 75906 Paris Cedex 15, France
Tel: +33 1 71 71 54 30   Fax: +33 1 71 71 52 08   Mobile: +33 6 03 00 65 75
____________________________________________________________________________



  parent reply	other threads:[~2001-08-13  8:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-10 18:37 Reading variable-length records from a file Brian Catlin
2001-08-10 19:04 ` Larry Kilgallen
2001-08-10 21:28 ` Mark Johnson
2001-08-13  8:14 ` Thierry Lelegard [this message]
2001-08-13 17:39   ` Brian Catlin
2001-08-13 18:29     ` tmoran
2001-08-13 18:51     ` Larry Kilgallen
  -- strict thread matches above, loose matches on Subject: below --
2001-08-13 21:29 Gautier Write-only-address
2001-08-13 22:41 ` Larry Kilgallen
replies disabled

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