![]()
|
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 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 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.. |