[plt-scheme] get-directory question

From: praimon (praimon at gmail.com)
Date: Sun Jun 21 20:36:12 EDT 2009

hello,
Here's something I don't understand. On 4.1.5 winxp:
(filter file-exists? (directory-list (get-directory)))
will return the null list for just about every gotten directory.

I think what's happening is that the files returned by directory-list
have the current-directory's path prepended, and except in wild
coincidences, such files don't exist.

I can by-pass this 'problem' by explicitly setting the current-directory:
(let ([dir (get-directory)])
    (current-directory dir)
    (filter file-exists? (directory-list dir)))

Is there a better way?
regards,
praimon


Posted on the users mailing list.