How to Empty a folder

Dear all,

I have a folder it contains files.I need to delet all the files in that folder.???

Thanks in ADVANNCE

Siva

Hi Siva,

A Little more specific detail would lead us in giving you the apt solution.

i.e What folder is it? Where is it situated, What info you want to delete?

Hi Shona

A folder in clinet machine ,it contains image files after uploading that file from that folder ,i need to delete the uploaded images file in that folder.

And dear what seems to be your problem in doing so? Cant you just delete it the usual way?

Hmmm…

Seems question is how to delete some files programmatically, and, according to tags added, it is about Axapta - then this thread should be moved to corresponding forum.

P.RAM, please confirm is it as I suggest, and further on be more detailed in your questions, plus, choose the right forum, that will speed up getting answers [:)]

Moderator

Thread moved to AX Developers Forum.

Hi Ram,

Pseudo code below -


int handle;
FileName fileName;
;

[handle, fileName] = winAPI::findFirstFile(<folder path + pattern >); //E - “C:\Users\Test\*.csv”

while (fileName)
{
winAPI:CloseHandle(handle)
winAPI::deleteFile(fileName)
}


Best wishes,