in reply to Deleting folder from FTP server

Hi

Well... this is what I would do:

1. Connect to FTP server 2. Get a directory listing of the required location 3. Iterate through the list of directories and: 3.1. Disregard directories that don't match the date format 3.2. Keep record of the oldest directory (so far) 3.3. Count number of directories with date format name 4. Sanity checks (there's more than 1 valid directory, etc) 5. Delete the oldest directory found in the loop

If that was what you were after... ?

If you were wanting more specific code, perhaps post some code and say what doesn't work, or where you don't know what to do next.

FalseVinylShrub

Disclaimer: Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.

Replies are listed 'Best First'.
Re^2: Deleting folder from FTP server
by premal (Acolyte) on Dec 18, 2009 at 11:15 UTC
    I will try to implement the steps you have suggested. Thanks for your help