schemekawa

Listing the contents of a directory (Windows 7)


Using Kawa 1.14.

I have tried opening the directory as a file (because file-exists? reports #t), and using read-line to read the "contents", but it does not work. I get an "Access denied" error.


Solution

  • Looking through the source, I found kawa\lib\files.scm, which defines directory-files.

    So, it is just a matter of:

    (require <kawa.lib.files>)
    (directory-files path)