[plt-scheme] get-directory question

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Jun 21 20:39:55 EDT 2009

Probably best to use build-path with the result of (get-directory) and
the elements of directory-list.

Robby

On Sunday, June 21, 2009, praimon <praimon at gmail.com> wrote:
> 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
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.