Forums
You may post here on any subjects related to this site or the software therein.
(Most everything on this site is tied into the forums so that you may leave or post comments about it.)
RE:CFX_IMageInfo leaving directory in use?
From: Lewis Sellers Date: January 02 2003 8:01 PM
| | Hello.
Been rather busy of late so didn't seen your post till now. Sorry. But that's also the thing I love most about open source -- sometimes problems can fix themselves (sort of).
Anyway, will fix the bug in the version downloadable on this site and add you the credits (like I do everyone that posts a bug fix.)
Thanks. Sorry about the hassle though.
--min
CFX_IMageInfo leaving directory in use?
From: Steve Hammonds Date: September 24 2003 11:51 AM
| | I have a template that loops over a directory structure and uses CFX_IMageInfo to retrieve information for the images in the directory. If the image height is greater than the width I cfexecute to irfanview and rotate the image. Then I move the file using cffile and delete the directory.
The problem is that I can`t delete the directory after it has been emptied, even manually. I get a sharing violation and I am told that the directory is in use. I have commented out portions of my code and am left to conclude that CFX_ImageINfo is somehow causing Cold Fusion to leave the directory in use. Restarting CF releases the directory and I can delete it. I checked CF administrator and I am am NOT keeping the CFX_IMageInfo library loaded.
We are running CF 4.5 and the server is Windows 2000 with IIS.
Any tips, comments??
RE:more information
From: Date: September 24 2003 11:52 AM
| | Here`s some code that can reproduce the problem:
Code:
<!--- directory strucuture
root
folder1
image file
--->
<cfset rootdir=`d:cfusiontemplatecfproequipmentdrawingstestroot2`>
<cfset movedir=`d:cfusiontemplatecfproequipmentdrawingstestdest`>
<cfdirectory action=`list` name=`thefolders` directory=`#rootdir#`>
<cfdump var=`#thefolders#`>
<cfloop query=`thefolders`>
<cfif not comparenocase(type,`dir`) and comparenocase(name,`.`) and comparenocase(name,`..`)>
<CFX_ImageInfo folder=`#rootdir##name#` filter=`*.tif`>
<cfdump var=`#imageinfo#`>
<cfif len(imageinfoerror) is 0><!--- got some files --->
<cfset dirname=name>
<cfloop query=`imageinfo`>
<cffile action=`MOVE` source=`#rootdir##dirname##file#` destination=`#movedir##file#`>
</cfloop>
<cfdirectory action=`delete` directory=`#rootdir##name#`>
</cfif>
</cfif>
</cfloop>
RE:CFX_IMageInfo leaving directory in use?
From: Steve Hammonds Date: September 24 2003 2:35 PM
| | Fixed it!
The source code was graciously included with the custom tag. In the request.cpp file you make a call to ImageInfo. ImageInfo declares a HANDLE called hFolder that never gets released. I added `FindClose(hFolder);` to the end of ImageInfo function and recompiled. I had to restart the cold Fusion server for it to recognize the new dll file but the problem is solved!
|