Michael Piepers homepage
BeOS Programs
PalmBeach
PSION Link Protocol description
RFSV Protocol description

RFSV command FDIRREAD


Description of command

The command FDIRREAD requests contents of a complete directory. However the implementation in the PSION has only a Buffer of 590 byte size. Thus the command must be transmitted with bigger directories several times around all file entries to receive. The end of the list is achieved if the message " eof " is transmitted as result.

The command FINFO is comparable with this command. FINFO returns the delivery the information however only for an already well-known directory entry.

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!


Transmission direction (command) in the interface format

That command FDIRREAD has always the same format. It is as a consequence;en built into the PLP:

Header PLP RFSV FDIRREAD Footer CRC
16 10 02 32 03 02 01 Command
00 00
Size
02 00
file handle
01 00
10 03 12 34

Receipt direction (result) in the interface format

A valid response takes place with the command RESPONSE and returns the delivery an error code and several file information.

The block "Fileinfo" contains all information of a file or folder. Whenever this section is repeated, until all entries of the directory are contained, or which is filled internal buffers! Thereby if the max. length of the PLP is exceeded, then the message is divided into several partial messages!

Header PLP RFSV RESPONSE ...
16 10 02 33 02 03 01 Command
2a 00
Size
5a 00
Result
00 00
Size 2
56 00
...
...

... File info. can be several times contained! ...
...
...
Version
02 00
Status
21 05
File Size
a8 02 00 00
Mod.Date
14 5d 6f 33
Reserve
ff ff ff ff
File name
"agenda.agn"
...
...

Footer CRC

10 03 12 34

boldValues represent fixed of values, which are used accurately in such a way!
italicValues represent examples, which have a different meaning on the basis the command.


Description of command

The command FDIRREAD consists of 3 information units. These have the following meanings:

Length in byte possible values Meaning
Command 2 byte 00 06 (fixed) The command identifier has always the same value!
Size 2 byte 00 02 (fixed) Always two bytes will transfer.
File handle 2 byte variable The file handle is to be transferred, which was returned the delivery, when with FOPEN the directory was opened.

Description of result

The command FDIRREAD is answered with RESPONSE. This returns the delivery an error code as result. If 00 00 is returned the delivery, then no error occurred.

Length in byte possible values Meaning
Command 2 byte 00 2a (fixed) The command identifier has always the same value!
Size 2 byte variable Dependent on the number of transmitted information units
Result 2 byte variable The result can obtain the following values:
NO_ERROR 00 00No error occurred
You can look at all defined errorvalues.
Size 2 2 byte variable The length supplies to bytes, in which the information of the files is stored.
The following block can occur several times and describes accurately in each case a file or a folder!
Version 2 byte 00 02 At present only the version 2 is supported.
Status 2 byte variable Describes the status of file or a folder. The following status are possible:
P_FAWRITE 00 01Into the file can be written
P_FAHIDDEN 00 02The file is hidden
P_FASYSTEM 00 04The file is a system file
P_FAVOLUME 00 08This entry is the DEVICE name
P_FADIR 00 10This entry is a directory
P_FAMOD 00 20This entry was changed and was set therefore the Modify flag
P_FAREAD 01 00From this file can be read
P_FAEXEC 02 00This program may be started
P_FASTREAM 04 00This entry is a byte stream file
P_FATEXT 08 00This entry is a text file
File Size 4 byte variable The size of the file in absolute bytes is returned the delivery.
Modification date 4 byte variable The modification date of the file is indicated in secondes since the Jan. 1. 1970
Reserve 4 byte ff ff ff ff For extensions of the log 4 bytes were kept free
File name at least 1 byte 0-terminated string Only the file name is entered. The path may not be indicated. There is max. possible for 128 byte!
The preceding block up to the first yellow beam can occur repeatedly!

Michael Piepers homepage
BeOS Programs
PalmBeach
PSION Link Protocol description
RFSV Protocol description

Last modification Jan 31 1999 by Michael Pieper