| 
 
	Checked FTP is intended to be run repeatedly to complete a file transfer.  It is recommended that it is
	scheduled using a chron job (on UNIX), the at command (on Windows) or any other scheduling mechanism.
 
	When the sending system wants to send files to the receiving system, the sending system must do the
	following:
	 
		- Create the directory to be sent (if not already present).
 
		- Fill it with files to be transferred.
		
 - Perform any additional processing, as needed.
 
		- The last action must be the creation of a file named 
directory/commands.
			This file may be empty but must be readable by Checked FTP when all data is ready to be sent
			(not before).  Its presence signals Checked FTP to transfer the files the next time Checked FTP
			is invoked. 
		- Once the file transfer has been acknowledged by the receiving systems (see the steps below),
			Checked FTP will delete or archive the directory.
 
	 
	In order to process a directory the receiving system must do the following:
	 
		- Query for the presence of a 
directory/commands file. The presence of this
			file indicates that the file transfer is complete and the directory may be processed. 
		- Perform any processing against the files in the directory.
 
		- When processing is finished create a file named 
directory/done. This file
			may be empty but must only be readable by Checked FTP.  Its presence signals Checked FTP that
			the transferred files have been processed.  The next invocation of Checked FTP will delete or
			archive the files on both the sending and receiving systems. 
		- If the receiving system wishes the files to be resent, it should delete the
			
directory/commands file.  The absence of this file will trigger a file
			transfer the next time Checked FTP is invoked. 
	 
	In a sense, Checked FTP is a state machine.  When invoked, it reads files on both the local and remote
	system to determine what action to take.  It then completes the action and exits.  Here is a summary of
	the actions taken:
	 
		
			|             State                | 
			            Source Files         | 
			            Destination Files    | 
			Action               | 
		 
		
			            command | 
			            command | 
			            done    | 
		 
		
			| 0 | 
			absent | 
			  | 
			  | 
			Waiting for sender: 
				Either the directory is not readable or the source system has not finished writing it.
				No action will be taken. | 
		 
		
			| 1 | 
			present | 
			absent | 
			  | 
			Upload directory: 
				The transfer is either (a) not started (b) interrupted or (c) re-requested by the receiving
				system.  CheckedFTP will re-transmit all files. The last file created in the destination
				directory will be command. This file will indicate a successful transfer. | 
		 
		
			| 2 | 
			present | 
			present | 
			absent | 
			Waiting for receiver: 
				Receiver is processing files. No action taken. | 
		 
		
			| 3 | 
			present | 
			present | 
			present | 
			Transfer confirmed: 
				Receiver has completed processing files. Checked FTP will attempt to delete or archive the
				directory. | 
		 
	 
	Please note that the state is independent of the command-line return values.
 
							 |