we are on a locking thread on CFTALK at the mo.....  the theory is sound and
can be applied to your case..... just ignore the XML bit.... it will prevent
a user from writing to a file while it is being read.

============================
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.




-----Original Message-----
From: Osullivan Karl (RKB) Senior Analyst/Programmer
[mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 16:45
To: 'CF - Development Group'
Subject: [ cf-dev ] Forcing a job to wait / file attributes


Hello,

I'm using CFFILE to grab a spooled text file so I can grab out certain
fields and then populate a table.

How do I ensure that the file I'm grabbing is complete, and not still being
written to?  Also, if it is being written to, how can I force the page to
wait for, say 5 seconds, and then try again?

Thanks,

Karl.

Karl O'Sullivan
Senior Analyst Programmer
University Hospitals Coventry and Warwickshire NHS Trust
Tel: 024 7660 2020 x7578
[EMAIL PROTECTED]

-- 
** 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]

-- 
** 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