Deleting contents within a folder

2009-11-09 Thread Damo Drumm
Hi Im trying to delete all the contents within a folder using coldfusion, but its deleting the actual folder each time The contents of the folder contains be PDF's has anyone any tips on deleting the contents and not the actual folder Thanks

Re: Deleting contents within a folder

2009-11-09 Thread Barney Boisvert
If you don't mind synchronizing, you can just delete the directory (as you are now) and then recreate an empty one after you're done. Otherwise you'll need to use CFDIRECTORY to get a list of the contained files and delete them individually with CFFILE. cheers, barneyb On Monday, November 9,

Re: Deleting contents within a folder

2009-11-09 Thread JediHomer
You could use CFDirectory to get the listings of the directory, then loop over that calling FileDelete() on the results... 2009/11/9 Damo Drumm damien.dr...@quinn-group.com: Hi Im trying to delete all the contents within a folder using coldfusion, but its deleting the actual folder each

Re: Deleting contents within a folder

2009-11-09 Thread Charles Sheehan-Miles
cfdirectory action=list loop through the list cffile delete based on list contents On Mon, Nov 9, 2009 at 11:07 AM, Damo Drumm damien.dr...@quinn-group.comwrote: Hi Im trying to delete all the contents within a folder using coldfusion, but its deleting the actual folder each time The

RE: Deleting contents within a folder

2009-11-09 Thread LRS Scout
Get a list of the files with cfdirectory action=list then loop over the files. Delete the files with cffile action=delete -Original Message- From: Damo Drumm [mailto:damien.dr...@quinn-group.com] Sent: Monday, November 09, 2009 11:07 AM To: cf-talk Subject: Deleting contents within

RE: Deleting contents within a folder

2009-11-09 Thread Robert Harrison
, November 09, 2009 11:07 AM To: cf-talk Subject: Deleting contents within a folder Hi Im trying to delete all the contents within a folder using coldfusion, but its deleting the actual folder each time The contents of the folder contains be PDF's has anyone any tips on deleting the contents

Re: Deleting contents within a folder

2009-11-09 Thread Eric Cobb
I agree with Barney just deleting the directory and recreating it. Having to get a list of everything in the directory and then loop through that list and delete each item one-by-one seems dirty to me. That being said, if you do want to go the list/loop/delete route, I would suggest using

Re: Deleting contents within a folder

2009-11-09 Thread Kevin Pepperman
cflib has a function for this. http://cflib.org/udf/deleteDirectory ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: