Question

My folder looks this way

c:/bar/
c:/bar/dir1
c:/bar/dir2
c:/bar/00.txt
c:/bar/02.txt

I can list files

(directory "c:/bar/*.*")
(#P"c:/bar/00.txt" #P"c:/bar/01.txt")

but have a problem listing subdirectories

(directory "c:/bar/*")
NIL

(directory "c:/bar/*/")
NIL

What I am doing wrong?

Was it helpful?

Solution

Use :directories t in CCL:

(directory "C:/bar/*.*" :directories t)

However, if you want to write implementation independent code (e.g. a library you want to share), you should probably heed Vsevolod's recommendation, and use a compatibility layer like cl-fad.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top