1 02/25/74  Files in BASIC
 2 
 3 This segment explains the file naming conventions used by the new
 4 Multics basic.
 5 
 6      A  BASIC  random access file is a single-segment file in the
 7 Multics storage system.  A basic terminal format file  is  always
 8 read or written using an I/O switch.  The switch can be connected
 9 to  a device, segment or multi-segment file.  The file name given
10 in the BASIC file-statement specifies the file or I/O switch name
11 to be used for the file;  the type of the file,  terminal  format
12 or  random  access, is determined by inspecting the first word of
13 the file or, if the file does  not  exist,  by  the  first  BASIC
14 statement that accesses the file.
15 
16 
17      If the file name does not begin with a ":", the file name is
18 a  Multics pathname, either relative or absolute.  If the file is
19 a random access file,  the  BASIC  runtime  system  initiates  or
20 creates  the specified segment.  If the file is a terminal format
21 file, the BASIC runtime system  attaches  to  the  file  via  the
22 vfile_  I/O  module  using  a  unique  switch  name  of  the form
23 "basic.000001".  Examples of this type of file name are
24           alpha
25           >udd>Project>User>data
26 
27 
28      If the file name begins with a ":", the file name  can  have
29 one  of  two  formats: ":name" or ":name attach-description".  In
30 the first form, "name" is the name of an  I/O  switch  that  must
31 already  be  properly  attached.   In the second case, the string
32 "attach-description", which can contain blanks, specifies the way
33 the switch name should be attached if not already attached.   The
34 BASIC  runtime system opens the specified I/O switch if it is not
35 already open;  if the  switch  is  open,  it  is  assumed  to  be
36 properly positioned and is not closed at termination of the BASIC
37 program.   A  file  name  beginning  with  ":" cannot be used for
38 random access files.  Examples of this type of file name are
39           :user_output
40           :xxx vfile_ xxx_file
41           :out syn_ user_i/o
42 
43 
44 This section  lists  the  I/O  switch  attachments  that  can  be
45 specified in a BASIC file name.
46 
47 Files in the storage system: (vfile_)
48 attach-description must be of the form
49 
50           vfile_ f
51 
52 where  f  is  an  absolute or relative pathname that identifies a
53 file.
54 
55 Files on tape: (ntape_)
56 attach-description must be of the form
57 
58           ntape_ r -raw [-write]
59 
60 where r is a string identifying the reel to be read  or  written.
61 The string r should end with the sequence ",7track" or ",9track",
62 indicating the type of tape to be read or written.  If neither of
63 these endings are present, "9track" is assumed.
64 
65 The   -write  option  causes  the  reel  to  be  mounted  with  a
66 write-permit ring.   This  option  is  required  if  the  program
67 contains  print-statements  or scratch-statements that access the
68 file.
69 
70 The -raw option is required;  it means that each line in the file
71 corresponds to a single physical tape record.
72 
73 
74 Terminal input/output:
75 attach-description must be of the form
76 
77           tty_ d
78 
79 where d is the string,  obtainable  from  the  print_attach_table
80 (pat)  command,  that  identifies the terminal device assigned to
81 the I/O switch name user_i/o in the user's process.
82 
83 Synonym attachments:
84 attach-description must be of the form
85 
86           syn_ n
87 
88 where n is the name of an I/O switch through which all operations
89 on this switch are to be directed.  Such a switch must  exist  at
90 the  time  the  switch is opened, although it need not exist when
91 the switch is attached.  The I/O  switch  whose  name  is  n  can
92 itself  be attached as a synonym for another I/O switch.  The I/O
93 switch that is the final destination of  the  synonym  attachment
94 must  be  attached  to  a  file or device and must specify an I/O
95 module.