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,2e1e48cc9f87abf9,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-03 08:31:11 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!panix!cmcl2!admii!nvl-times!oliver!shaffer From: shaffer@oliver (Dolores Shaffer) Subject: newbie binary file I/O question Message-ID: X-Disclaimer: Opinions expressed are not necessarily those of NVL Keywords: sequential_io Sender: news@nvl.army.mil Organization: Night_Vision Date: Fri, 3 Mar 1995 16:31:11 GMT Date: 1995-03-03T16:31:11+00:00 List-Id: Hi, I am using an old Telesoft Ada compiler on a Sun workstation. I have a binary file that I would like to open and read one byte at a time. If the code asks the user for the file name and then stores that in a string variable, and the code passes that variable to the open procedure, I get a NAME_ERROR and the code bombs. If the code passes the name of the binary file in quotes, it works. I am able to use text_io.open to open text files whose names are passed to open in a string variable. Any suggestions? Here is part of the code: with text_io; with sequential_io; procedure nextstep is Package byte_io is new sequential_io(intbyte); din_file: byte_io.file_type; value:intbyte; name_of_file: string(1..80); name_length : natural; begin text_io.put_line("enter name of file to open"); text_io.get_line(name_of_file,name_length); byte_io.open(din_file, byte_io.file_mode'first, name=>name_of_file); --IT BOMBS HERE!! --but byte_io.open(din_file, byte_io.file_mode'first, "filename"); works -- D. A. Shaffer, shaffer@nvl.army.mil Night Vision & Electronic Sensors Directorate DISCLAIMER: facts & opinions expressed are not necessarily those of Night Vision & Electronic Sensors Directorate.