(delete-file) does not accept wildcards?

For the Compleat Fan
Locked
pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

(delete-file) does not accept wildcards?

Post by pjot »

Hi,

It seems that this code is not working:
> (delete-file "somedir/*.*")
nil
Why not? Do I first have to setup a list of files in that directory, and then walk through that list to delete them one-by-one...? :-(

Regards
Peter

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

I suspect that delete-file only takes a filename, not a pathname. So *.* isn't valid.

Just a thought.

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Code: Select all

(dolist (x (directory temp_dir)) (delete-file (append temp_dir "/" x)))
...but the wildcard is more easy.

Peter

Locked