From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ccc96dfdd6a003a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-13 01:15:03 PST Path: archiver1.google.com!news2.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!fr.usenet-edu.net!usenet-edu.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: Thierry Lelegard Newsgroups: comp.lang.ada Subject: Re: Reading variable-length records from a file Date: Mon, 13 Aug 2001 10:14:38 +0200 Organization: CANAL+ Technologies Message-ID: <3B778C6E.9B43450D@canal-plus.fr> References: <9l19l4$45m$1@slb7.atl.mindspring.net> NNTP-Posting-Host: host227.canal-plus.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: s1.read.news.oleane.net 997690478 5830 194.2.208.227 (13 Aug 2001 08:14:38 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 13 Aug 2001 08:14:38 +0000 (UTC) X-Sender: "Thierry Lelegard" (Unverified) X-Mailer: Mozilla 4.75 [fr]C-CCK-MCD C+ (WinNT; U) X-Accept-Language: en,fr,zh-CN,zh-TW Xref: archiver1.google.com comp.lang.ada:11834 Date: 2001-08-13T10:14:38+02:00 List-Id: > 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 ____________________________________________________________________________