Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to remove an existing directory programatically?
Message
 
À
15/10/2002 22:22:52
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00711569
Message ID:
00712645
Vues:
18
>Hi all:
>
>I am attempting to first, delete an existing directory and all subfolders within that directory and then create a new directory with subdirectories where needed.
>
>I have tried the RMDIR and RD commands - but get a message that says "File Access is Denied". Clicking HELP tells me that I am trying to write to a protected file (whihc is not true).
>
>Any suggestions? Thank you in advance.

Hi Henry.
You cannot RMDIR a directory if it contains files and/or directory.
You must build a recursive function which:
- receives a path
- deletes all files: delete file (cPath+"\*.*")
- gets a list of subdirectories (ADIR)
- for each subdirectory (if any) call self
- finally RMDIR (cPath)

Hope this helps and bye.
Jose.
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform