The attribute transfers over FTP was created with the cooperation of Zeid Derhally and Stegemann & Co.. Campus is the first FTP server and NetPenguin is the first FTP client on BeOS to support the FTP extension. Below is a very simple explanation of the extension so that other developers may add support for it in their FTP applications.

The attribute commands are an extension of the ftp protocol so they are found and executed by issuing the "SITE" command. The attribute commands are as follows: LSAT, SATT, and RATT. For NetPenguin to find out wether the ftp site it is connected supports attribute transfers, it sends the command "HELP SITE" which the server replies to with the commands that it supports. Here is a sample:

HELP SITE
214- The following SITE commands are recognized (* =>'s unimplemented).
UMASK IDLE CHMOD HELP LSAT RATT SATT
214 Direct comments to ftp-bugs@192.168.0.3

As you can see the attribute commands are listed as part of the other ftp extension commands. If NetPenguin does not find any of the attribute commands as part of the list it will not initiate any attribute transfers.

LSAT is the command to list the attributes of a file. The syntax for the command would look like "SITE LSAT <filename>" and the server would return something like this if it were invoked on a People file

SITE LSAT peoplefile
150 Opening BINARY mode data connection for /bin/listattr.
4d494d53 21 BEOS:TYPE
43535452 14 META:name
43535452 5 META:firstname
43535452 9 META:lastname
43535452 17 META:company
43535452 28 META:address
43535452 7 META:city
43535452 3 META:state
43535452 6 META:zip
43535452 13 META:hphone
43535452 13 META:wphone
43535452 13 META:fax
43535452 16 META:email
43535452 14 META:nickname
226 LSAT command successful.

The first column of numbers is the hex value of the type of attribute. In this case 43535452 would be B_STRING_TYPE. This is necessary so the ftp client knows how to store the attribute on its side. The second column of numbers is the size of the attribute in bytes. Finally the third column is the name of the attribute.

To retrieve an attribute the ftp client uses RATT command. The syntax for the command is "SITE RATT <filename> <attribute name>". So if NetPenguin wanted to retrieve the name attribute of the people file it would send SITE RATT "peoplefile" META:name".

The syntax for SATT, for sending attributes, is "SITE SATT <filename> <attribute name> <hex value of attribute type>". So if the client wanted to send the name attribute of the people file to the server it would issue the command SITE SATT "peoplefile" META:name 43535452.

NetPenguin will only send and receive attributes of a file after it has finished uploading or downloading the file. It was actually not very hard to implement after Joerg Stegemann and I agreed on the names of the commands. This is a relatively easy thing to implement by a FTP server or client. Ofcourse the BeOS has API's for writing and reading the attributes of the file which are part of the Storage Kit in the BeBook.

If you need any more info or have any questions please let me know and I will be happy to ask. Please email me or email Stegemann & Co..







Be, BeOS, and the Be and BeOS logos are registered trademarks of Be Incorporated.
The icons used herein are the property of Be, Incorporated and are used by permission.
Desert Nights, Desert Nights Logo, and the NetPenguin icon are trademarks of Desert Nights.
Copyright 1998-1999 © Zeid Derhally