|
-
Feb 12th, 2012, 12:47 AM
#1
Thread Starter
Hyperactive Member
Classic ASP Do until FileExists?
I am using a WScript.Shell to call a Java class that creates a file. I need to be able to wait until the file gets created (usually about 15-20 seconds) before I try to open this file in the ASP page.
I tried to use a Do Until fs.FileExists(outFile) loop but that pegs the CPU Cycles out and then the file never gets created. The same goes for any of the normal "Do until" pause couters floating around on the net.
I have also read about WScript.Sleep but that apparently does not work in ASP, only in VBScript files.
I CANNOT use a page refresh to try and check for the file either. The reason is there is a lot of things happening on this page before this point (creating a temp folder, copying files, etc.) and there is response.write after each step to keep the user informed. A refresh would start the process all over.
What I really need is a way to loop asynchronously to allow the background Java to finish creating the file instead of the loop pegging out the server. So something like:
Code:
Do until fs.FileExists(outFile)
DoEvents
loop
Anyone have any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|