kind of...

make this custom tag....

utilDeleteDir.cfm
---------------------------------------------------------------------
<CFDIRECTORY DIRECTORY="#attributes.rootFolder#" NAME="fileList">

<!--- delete files --->
<cfoutput query="fileList" startRow="#request.startRow#">
        <cfif type IS "dir">
                <cf_utilDeleteDir
rootFolder="#attributes.rootFolder#/#name#">
        <cfelse>
                <cffile action="delete"
file="#attributes.rootFolder#/#name#">
        </cfif>
</cfoutput>

<!--- directory is now empty --->
<cfdirectory action="DELETE" directory="#attributes.rootFolder#">
----------------------------------------------------------------------

now you can call it like this:
        <cf_utilDeleteDir rootFolder="C:/myFolder">
and it will be deleted no matter what's inside.

REQUEST.STARTROW depends on the machine's OS.  For UNIX set it to 1, 
for
WINDOWS set it to 3 (windows ALWAYS returns . and .. as the first two
records and you don't want to mess with these).

The backslash (\) only works in Windows while the forslash (/) works on
Windows and UNIX.

*** I am not responsible for any misuse of this tag! ***

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may 
have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Shawn Regan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 15, 2002 10:55 AM
To: CF-Talk
Subject: CFDirectory


Hello cf friends,

Is there a way to force cfdirectory to delete a directory even if it is 
not
empty?

Shawn Regan
Applications Developer
pacifictechnologysolutions



______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to