Seems a bit cumbersome all that lot, but probably necessary if there are
file operations being done by other apps.

But if the file ops are purely done by the CF app, its much easier to use
(exclusive) named locks. You can use the filename as the name of the lock,
and do that with any file operation.

<cflock type="EXCLUSIVE" name="#MyFileName#" timeout="5">
 <cffile action="READ" file="#MyFileName#" ... blah blah blah>
</cflock>

As I say, its only useful if all file ops are through the CF app because if
somebody is overwriting the file via ftp it won't have a cflock on it.

Taz

> ============================
> Use a semaphore or lock file. When someone grabs addams.xml for editing,
> write a really small file called addams.lck to the same directory. When
done
> processing, delete the addams.lck file. Change the process to look for the
> existence of a <filename>.lck file and if one exists deny access to the
> <filename>.xml file.
>
> You'll need to have a method of clearing old locks, in case someone
abandons
> the process in the middle. The timestamp on the <filename>.lck file should
> be sufficient. I'd think a lock file over eight hours old ought to be
> considered ignorable.


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to