comp.lang.ada
 help / color / mirror / Atom feed
* newbie binary file I/O question
@ 1995-03-03 16:31 Dolores Shaffer
  1995-03-04 16:01 ` Tore Joergensen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dolores Shaffer @ 1995-03-03 16:31 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-03-14 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-03 16:31 newbie binary file I/O question Dolores Shaffer
1995-03-04 16:01 ` Tore Joergensen
1995-03-05 23:04 ` Keith Thompson
1995-03-14 16:18 ` Michael M. Bishop

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