Re: delete directory

Rainer Joswig <[email protected]> Mon, 16 Feb 2009 14:13:46 +0100
Newsgroups gmane.lisp.cl-http,gmane.spam.detected
Message-ID <[email protected]>
Am 13.02.2009 um 19:54 schrieb Cristina G. Muñoz:

> Hello!
>
> Is it possible to delete a directory with the files contained in?,  
> Or if it isn't, how can i delete an empty directory . I tried :  
> (delete-file "http:www;cl-http;cursos;cris"), and i only can delete  
> a text file, (delete-file "http:www;cl-http;cursos;cris;cris.txt").
>
> Thank you.
>
>

Hi,

LispWorks has for example the (LispWorks specific) function DELETE- 
DIRECTORY .

CL-USER 10 > (delete-directory #P"/private/tmp/foo/")
T

You have to delete all the files in the directory first (using DELETE- 
FILE) and the process needs the necessary rights to delete this  
directory - as usual.

Note that most Lisp systems also allow to call Unix scripts. LispWorks  
for example uses the function SYSTEM:CALL-SYSTEM .

Example:

CL-USER 11 > (system:call-system "rmdir /private/tmp/foo/")
0

Regards,

Rainer Joswig



> _______________________________________________
> WWW-CL mailing list
> [email protected]
> https://lists.csail.mit.edu/mailman/listinfo/www-cl

Rainer Joswig, Hamburg, Germany
http://lispm.dyndns.org/
mailto:[email protected]

_______________________________________________
WWW-CL mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/www-cl