If you're running CFMX you can create a simple wait() function that does
not consume server resources using the code Douglas posted.
If you're not on CFMX, you have a few options if you need to wait for a
specific period of time.
1. Go to the Developer's exchange on the Macromedia site and search for
wait. You should find a few custom tags that will allow you to do what
you need.
2. Output a 'please wait' page to the user with the following in the
<head></head> section:
<meta http-equiv="refresh" content="10">
3. Output a 'please wait' page to the user with the following in the
<head></head> section:
<script>setTimeout("location.reload()", 10000);</script>
The JavaScript and <meta> tag solutions rely on browser support, but
don't require a custom tag.
Depending on your situation, any of these 3 solutions may work.
Spike
Stephen Milligan
Team Macromedia - ColdFusion
Co-author 'Reality Macromedia ColdFusion MX: Intranets and Content
Management'
http://spikefu.blogspot.com
> -----Original Message-----
> From: Osullivan Karl (RKB) Senior Analyst/Programmer
> [mailto:[EMAIL PROTECTED]]
> Sent: 17 October 2002 09:39
> To: '[EMAIL PROTECTED]'
> Subject: RE: [ cf-dev ] Forcing a job to wait / file attributes
>
>
> Ok,
>
> So if I check the file exists, then read it in I'm going to
> check the last line as I know what should be on it. If it's
> not I want to wait 10 seconds and then retry. Sorry, but I
> didn't really understand the bit below, especially the
> creation of some java object.
>
> Thanks,
>
> Karl O'Sullivan
> Senior Analyst Programmer
> University Hospitals Coventry and Warwickshire NHS Trust
> Tel: 024 7660 2020 x7578
> [EMAIL PROTECTED]
>
> > ----------
> > From: Douglas Humphris[SMTP:[EMAIL PROTECTED]]
> > Sent: 16 October 2002 16:48
> > To: [EMAIL PROTECTED]
> > Subject: RE: [ cf-dev ] Forcing a job to wait / file attributes
> >
> > Karl,
> >
> > I think I got this UDF/Custom Tag from Spike's blog a few weeks ago:
> >
> > <CFPARAM name="attributes.milliseconds" default="1">
> >
> > <CFSCRIPT>
> > function sleep(timeMillis) {
> > var thread = createObject("java", "java.lang.Thread");
> > thread.sleep(timeMillis); }
> > sleep(#attributes.milliseconds#);
> > </CFSCRIPT>
> >
> > it causes the process to "sleep" for the specified no of
> milliseconds.
> >
> > HTH Douglas
> >
> > -----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]
> >
>
> --
> ** 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]