Subversion Repositories Spectranet

[/] [trunk/] [tnfs/] [tnfs-protocol.txt] - Diff between revs 546 and 570

Show entire file | Details | Blame | View Log

Rev 546 Rev 570
Line 347... Line 347...
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.
 
 
The server will only reply with as much data as fits in the maximum
The server will only reply with as much data as fits in the maximum
TNFS datagram size of 1K. If there is less than the size requested
TNFS datagram size of 1K when using UDP as a transport. For the
remaining in the file, the server will return the remainder of the file.
TCP transport, sequencing and buffering etc. are just left up to
Subsequent READ commands will return the code EOF.
the TCP stack, so a READ operation can return blocks of up to 64K.
 
 
 
If there is less than the size requested remaining in the file,
 
the server will return the remainder of the file.  Subsequent READ
 
commands will return the code EOF.
 
 
Examples:
Examples:
Read from fd 4, maximum 256 bytes:
Read from fd 4, maximum 256 bytes:
 
 
0xBEEF 0x00 0x21 0x04 0x00 0x01
0xBEEF 0x00 0x21 0x04 0x00 0x01