Sends an FPEnumerateExt2 request to the server and handles the response fp_get_file_dir_parms (self, volume_id, did, file_bitmap, dir_bitmap, path) Sends an FPCloseVol request to the server and handles the response fp_create_dir (self, vol_id, dir_id, path)įPCreateDir fp_create_file (self, flag, vol_id, did, path)įPCreateFile fp_enumerate_ext2 (self, volume_id, did, file_bitmap, dir_bitmap, req_count, start_index, reply_size, path) Sends an DSIOpenSession request to the server and handles the response fp_close_fork (self, fork)įPCloseFork fp_close_vol (self, volume_id) Sends an DSICloseSession request to the server and handles the response dsi_open_session (self, host, port) List the contents of a directory DirTree (self, str_path, options)ĭisplays a directory tree dsi_close_session (self) Functions acl_group_to_long_string (acls)Ĭonverts a group bitmask of Search, Read and Write to table acls_to_long_string (acls)Ĭonverts a numeric acl to string CloseSession (self)Ĭloses the AFP session and then the socket create_fp_packet (self, command, data_offset, data)Ĭreates an AFP packet CreateDir (self, str_path)Ĭreates a new directory on the AFP sharepoint decode_dir_bitmap (bitmap, data, pos)ĭecodes a directory bitmap decode_file_bitmap (bitmap, data, pos)ĭecodes a file bitmap decode_unix_privs (privs)ĭecodes the UnixPrivileges.ua_permissions value Dir (self, str_path, options, depth, parent) Once we're finished, we need to logout and close the AFP session this is done by calling theįollowing two methods of the Helper class:Ĭonsult the documentation of each function to learn more about their respective return values. Status, response = helper:Login('admin', 'nimda')Īt this stage we're authenticated and can call any of the AFP functions we're authorized to.įor the purpose of this documentation, we will attempt to list the servers share points. To authenticate to the server using the username 'admin' and password 'nimda' we do this instead: This can be achieved by calling the Login method In order to authenticate as the public user simplyĪuthenticate using nil for both username and password. We need to do this even forįunctions that are available publicly. The next step needed to be performed is to authenticate to the server. Next a session to the AFP server must be established, this is done using the OpenSession method of the The script has to create its own instance. Here's the longer version, with some explanatory text. Status, response = helper:OpenSession( host, port ) The following information will describe how to use the AFP Helper class to communicate with an AFP server. ** The Util class contains a number of static functions mainly used to convert data. ** The purpose of this class is to give developers easy access to some of the common AFP tasks. For example, ReadFile and usually call several functions in the Proto class. ** The helper class wraps the Proto class using functions with a more descriptive name. ** Some functions may lack some of the options outlined in Apple's documentation. ** The function names closely resemble those described in the Apple documentation. ** The functions can be accessed directly but the preferred method is through the Helper class. ** This class contains all the AFP specific functions and calls. ** The response class acts as a wrapper and holds the response data and any error information. ** A class used as return value by functions in the Proto class. The library contains the following four classes Most functions have been tested against both Mac OS X 10.6.2 and Netatalk 2.0.3 The library was built based on the following reference: Querying ACLs and mapping user identities (UIDs).Authentication using the DHX UAM (CAST128).The below commands will setup our drive to spin down after 30 minutes of no activity.This library was written by Patrik Karlsson to facilitateĬommunication with the Apple AFP Service. Spin Down Idle Driveīecause our server will be running 24 hours a day, it's a good idea to have the backup drive spin down when not in use. With the image mounted you will see a Time Machine Backups menu item in Finder under the Devices section. Double click on that file to mount the image. sparsebundle file, which is where your backup is stored as an image. This will allow you to browse the share which should look something like this: Then click the Connect As button in the upper right corner and enter your login credentials to the Raspberry Pi. Open up Finder and click on the raspberrypi menu item under Shared. Once your first backup has completed you probably want to take a look at the files. Once selected, use your SSH credentials to connect. Now that you have things setup on the Raspberry Pi, we just need to open up Time Machine and add our new disk.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |