Actually, the feature you are referring to does not have anything to do with
the operating system but rather the Web server. IIS creates handles to files
for fast references.

When you delete a file, you actually delete the file (contrary to what
Philip has suggested). The handle, however, is left open. A separate process
called the cache scavenger routinely goes through and checks to see which
files have been deleted. At this point the handle to the file is deleted and
the file "appears" to be deleted from the file system.

Although the frequency with which the cache scavenger checks file handles
can be adjusted, the performance benefits from this method are great, so it
is not recommended that you alter this setting. This is probably why it is
hidden in the registry. One side note, the cache scavenger is set by default
for something like every 60 seconds. You should not see the file for more
than 60 seconds unless someone has already played with this setting.

Now, as to the original question, is IIS indeed the Web server in question?
If so, is IIS touching the file in-between the write and delete operations?
This would invoke the caching mechanism discussed above. If this is the
case, there is not to much you can do except name the files uniquely. The
CreateUUID() function would probably be overkill: you could probably get
away with the RandRange() function if you are deleting the file immediately.

If the Web server is something other than IIS or IIS is not touching the
file in-between the write and delete operations, then the problem is
elsewhere. Are you always enclosing the CFFILE tag in an exclusive lock
using the CFLOCK tag? Not doing this would cause a whole host of issues, but
I wouldn't really expect the ones you've described.

Benjamin S. Rogers
Web Developer, c4.net
voice: (508) 240-0051
fax: (508) 240-0057


-----Original Message-----
From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:12 PM
To: CF-Talk
Subject: RE: CFFILE Delete then WRITE issue....


NT has this wonderful habit of not dealing with requests immediately - it
can mean that when you try to write a file it messes up and needs a slight
delay

Pain, but it's lovely M$ software!

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 09 January 2001 16:53
> To: CF-Talk
> Subject: CFFILE Delete then WRITE issue....
>
>
>
> OK.  I am having a problem here.  I am able to DELETE a file with CFFILE
> without a problem, but when I try to almost immediately WRITE the
> same file
> back it tells me there is an issue with the file "Error: The file
> could not
> be accessed."  Has anyone encountered this before?  When I check on the
> server for the file, what once was a 500k file, is now only 500 bytes, but
> when I try to open it there it tells me that the "file could not
> be found."
> But it exists.  And then I have to wait a while to get the OS to release
> it.  I check it 24 hours later (because I am working on other things too,
> and I so sleep some), and it works fine.  I think this is an issue if
> someone tries to OPEN the file instead of SAVING it.  So the second
> question is is there a way to force someone to DOWNLOAD the file
> instead of
> opening it?
>
> Also, when I browse that directory in CF Studio, the file name has a RED
> DOT to the left, and I have never seen this before.
>
> Any help would be MOST appreciated.
>
> Vance Duke
> Cold Fusion Application Developer
> i2 Technologies
> (469) 357-4729
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to