Subversion Repositories Spectranet

[/] [trunk/] [tnfs/] [tnfs-protocol.txt] - Diff between revs 483 and 494

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 483 Rev 494
Line 302... Line 302...
implemented by something else (for example, CREAT is equivalent
implemented by something else (for example, CREAT is equivalent
to OPEN with the O_CREAT flag). Not all servers will support all flags
to OPEN with the O_CREAT flag). Not all servers will support all flags
for OPEN, but at least O_RDONLY. The mode refers to UNIX file permissions,
for OPEN, but at least O_RDONLY. The mode refers to UNIX file permissions,
see the CHMOD command below.
see the CHMOD command below.
 
 
OPEN - Opens a file - Command 0x20
OPEN - Opens a file - Command 0x29
----------------------------------
----------------------------------
Format: Standard header, flags, mode, then the null terminated filename.
Format: Standard header, flags, mode, then the null terminated filename.
Flags are a bit field.
Flags are a bit field.
The filemodes are:
The filemodes are:
 
 
Line 337... Line 337...
is the file descriptor:
is the file descriptor:
 
 
0xBEEF 0x00 0x20 0x00 0x04 - Successful file open, file descriptor = 4
0xBEEF 0x00 0x20 0x00 0x04 - Successful file open, file descriptor = 4
0xBEEF 0x00 0x20 0x01 - File open failed with "permssion denied"
0xBEEF 0x00 0x20 0x01 - File open failed with "permssion denied"
 
 
 
(HISTORICAL NOTE: OPEN used to have command id 0x20, but with the
 
addition of extra flags, the id was changed so that servers could
 
support both the old style OPEN and the new OPEN)
 
 
READ - Reads from a file - Command 0x21
READ - Reads from a file - Command 0x21
---------------------------------------
---------------------------------------
Reads a block of data from a file. Consists of the standard header
Reads a block of data from a file. Consists of the standard header
followed by the file descriptor as returned by OPEN, then a 16 bit
followed by the file descriptor as returned by OPEN, then a 16 bit
little endian integer specifying the size of data that is requested.
little endian integer specifying the size of data that is requested.