Skip to main content
Known Participant
March 25, 2009
Question

deletling a folder and all the files & folders in it

  • March 25, 2009
  • 2 replies
  • 524 views
Hi,

Is there a way to delete all the files and folders in a directory, a custom tag or some code would help a lot.

<cfdirectory> should have a "destroy" action which deletes a folder and everything in it.

Thanks.
    This topic has been closed for replies.

    2 replies

    tclaremont
    Inspiring
    March 25, 2009
    <cfdirectory action="DELETE" directory="Foobar">
    Inspiring
    April 13, 2009

    <cfdirectory action="delete" directory="d:\directorytodelete\" recurse="true"> will work for this..

    Inspiring
    March 25, 2009
    I don't know why you couldn't do a <cfdirectory action="delete"
    recurse="yes">

    Should delete everything in subfolders, etc.....unless I'm
    misunderstanding the tag......


    Hulfy wrote:
    > Hi,
    >
    > Is there a way to delete all the files and folders in a directory, a custom
    > tag or some code would help a lot.
    >
    > <cfdirectory> should have a "destroy" action which deletes a folder and
    > everything in it.
    >
    > Thanks.
    >