! File system communication message formats and codes.  This is the internal
! standard way of transmitting requests between internal & external file system
! clients and internal & external file servers.  The format and request codes
! are intended to map easily to the new-style file access protocol used to
! communicate with remote file servers.

%conststring(31) local     file system mailbox = "LOCAL_FILESYSTEM_MAILBOX"
%conststring(31) special   file system mailbox = "SPECIAL_FILESYSTEM_MAILBOX"
%conststring(31) H2        file system mailbox = "H2_FILESYSTEM_MAILBOX"

%recordformat fs message fm(%record(message fm) system part,
                            %record(access fm)%name access,
                            %short tag, %byte code, subcode,
                            %integer status, error code,
                            %integer components translated,
                            %integer components translated 2,
                            %integer transaction flags,
                            %string(*)%name error text,
                            %record(*)%name filename,
                            %integer access mode, compatible mode,
                            %integer request flags, response flags,
                            %integer file token,
                            %integer block,
                            %integer bytes,
                            (%record(*)%name buffer %c
                             %or %string(*)%name textual info %c
                             %or %record(attributes list fm)%name attributes),
                            %integer partition,
                            (%record(*)%name filename 2 %c
                             %or %string(*)%name translation string))

%constinteger data access                    code = 0

%constinteger open file                   subcode = 0
%constinteger read data                   subcode = 1
%constinteger write data                  subcode = 2
%constinteger close file                  subcode = 3
%constinteger truncate file               subcode = 4
%constinteger make accessible             subcode = 5

%constinteger read       file                mode = 16_0001
%constinteger modify     file                mode = 16_0002
%constinteger append  to file                mode = 16_0004

%constinteger create if                      flag = 16_0001
%constinteger create                         flag = 16_0002
%constinteger temporary                      flag = 16_0004
%constinteger unique name                    flag = 16_0008
%constinteger no inherit                     flag = 16_0010

%constinteger file attributes access         code = 1

%constinteger obtain     attributes       subcode = 0
%constinteger obtain     attributes token subcode = 1
%constinteger short form attributes       subcode = 2;  ! Old-style NInfo-like
%constinteger modify     attributes       subcode = 3
%constinteger modify     attributes token subcode = 4
%constinteger file header                 subcode = 130

%constinteger directory access               code = 2

%constinteger list directory contents     subcode = 0
%constinteger insert directory entry      subcode = 1
%constinteger remove directory entry      subcode = 2
%constinteger create new directory        subcode = 3
%constinteger insert local translation    subcode = 128
%constinteger insert external translation subcode = 129
%constinteger enquire nth directory entry subcode = 130
%constinteger translate path              subcode = 131

%constinteger miscellaneous file operation   code = 3

%constinteger rename file                 subcode = 0
%constinteger copy file                   subcode = 1
%constinteger exchange files              subcode = 2
%constinteger delete file                 subcode = 3
%constinteger translate redirections      subcode = 4

%constinteger miscellaneous other operation  code = 4

%constinteger generate unique name        subcode = 0
%constinteger timestamp enquiry           subcode = 1

%end %of %file
