Print Page | Close Window

Include Files

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=19682
Printed Date: 29 March 2026 at 12:03pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Include Files
Posted By: lostcontrol
Subject: Include Files
Date Posted: 03 May 2006 at 11:39am
I am having a problem with Include files in my website when those files are beeing updated by the site. This causes an "Include file not found" error when people try to access the site at the instance when those files are in the proccess of beeing updated.

I have tried to resolve this problem by using FSO to check whether the file exists before trying to include it. However, this doesn't seem to work and my guess is that ASP tries to include the pages before executing the code.

Has anyone came across a similar situation or have something in mind that could help me check if a file exists before beeing included in the site?

Many thanks



Replies:
Posted By: dpyers
Date Posted: 03 May 2006 at 1:58pm
As you suspected, all includes are expanded before anything is processed. This make it impossible to do conditional includes - e.g. "include IF...".

Your particular solution will be to not directly update the include file. Update an edit version of the file and when done close it. Then delete the active include file and rename the edit version.

A delete/rename is quite a bit faster than a file open/edit/close as it only works with directory file indexes instead of with i/o and memory allocation/deallocation.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: lostcontrol
Date Posted: 04 May 2006 at 2:48pm
Many thanks for your reply dpyers!

I haven't thought of doing it like this... ill give it a try and see if it resolves this problem.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net