On Fri, 21 May 2010 13:41:25 -0500, Al Cole wrote:

>In all of the FTP data processes that I create, I require that the users edits 
>and maintains the data file in their application directories.
>When they have completed creating the file, the user or the application will 
>move the file to an FTP server. By doing so, the user or application is 
>stating that the file is complete and ready for processing.
>
An excellent idea.

My bias is toward a UNIX server.  Where can Ed get a UNIX server?
z/OS is UNIX!

Why UNIX?  So that Ed can copy the file to a temporary pathname
then rename() it to the target name.

POSIX rename() has some properties remarkably suited to this purpose:

o rename() is preemptive.  Any preexisting file with the target
  name is quietly and unconditionally replaced.

o rename() is atomic.  POSIX requires it to be so serialized
  that no other process can perceive an instant when the file
  does not appear to exist.

o rename() (and unlink()) obey a sort of LUW isolation.  If
  the FTP server begins reading the "old" copy and the rename
  occurs while the transfer is in progress, a reference count
  guarantees that data blocks will not be discarded/overwritten
  until the FTP server issues a close() for the descriptor of
  that file.  (PDSE works somewhat similarly.)

Guaranteed integrity with minimal serialization protocol
impacting the user.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to