Michael Piepers homepage | |||||
BeOS Programs | |||||
PalmBeach | |||||
PSION Link Protocol description | |||||
RFSV Protocol description |
The command FSEEK positions the file pointer on an indicated position within an opened file. There are various possibilities the position to determine. The command only works without an error, if the file was opened with the parameter FRANDOM set in the command FOPEN!
It is to be noted that; all values, which are more greater than 8 bits in reverse order will transfer. The LOW byte sent as the first over the line and only then follows the HIGH byte!
The instruction FSEEK is built into the PLP as shown in the following table:
Header | PLP | RFSV FSEEK | Footer | CRC | ||||
---|---|---|---|---|---|---|---|---|
16 10 02 | 32 03 02 01 | Command 0c 00 |
Size 08 00 |
File handle 01 00 |
Position 00 00 00 00 |
Mode 02 00 |
10 03 | 12 34 |
A valid response takes place with the command RESPONSE and returns the delivery an error code.
Header | PLP | RFSV RESPONSE | Footer | CRC | |||
---|---|---|---|---|---|---|---|
16 10 02 | 33 02 03 01 | Command 2a 00 |
Size 06 00 |
Result 00 00 |
current position bc 04 00 00 |
10 03 | 12 34 |
bold | Values represent fixed of values, which are used accurately in such a way! |
italic | Values represent examples, which have a different meaning on the basis the instruction. |
The command FSEEK consists of 5 information units. These have the following meanings:
Length in byte | possible values | Meaning | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Command | 2 byte | 00 0c (fixed) | The command identifier has always the same value! | ||||||||||||||||||
Size | 2 byte | 00 08 (fixed) | Always eight bytes will transfer. | ||||||||||||||||||
File handle | 2 byte | variable | The File handle is to be transferred, which the calling program with the Command FOPEN received. | ||||||||||||||||||
Position | 4 byte | variable | Dependent on the mode this value is interpreted different. It always indicates a length in bytes. Starting from which position this is however counted, results from contents of mode. | ||||||||||||||||||
Mode | 2 byte | variable | This value indicates, how the byte length in position is to be regarded. The following values are possible:
|
The command FSEEK is answered with RESPONSE. This returns the delivery as result an error code and the current position within files as absolute value of the start the file.
Length in byte | possible values | Meaning | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Command | 2 byte | 00 2a (fixed) | The command identifier has always the same value! | ||||||||
Size | 2 byte | 00 02 (fixed) | Always 2 additional byte are supplied! | ||||||||
Result | 2 byte | variable | The result can obtain the following values:
|
||||||||
Position | 4 byte | variable | The absolute position is indicated in bytes, at which the file pointer is after the command. |
Michael Piepers homepage | |||||
BeOS Programs | |||||
PalmBeach | |||||
PSION Link Protocol description | |||||
RFSV Protocol description |