[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: how I can check whether a directory exists with scheme



Hallo,
I want to parse a root directory for
other subdirectories.

Therefore I use the code like this
 ....
(do
	  ( (entry (readdir dir) (readdir dir)))
	  ( (eof-object? entry) )
	(let ((sub_dir (opendir (string-append root_path "/" entry))))	
        (if (sub_dir) ...


This code will fail with a System Error if entry a file name instead a directory.

opendir seems not deliver a #f like described in
the SCM-manual by Aubrey Jaffer.

Is there an other solution to check whether a string
corresponds to an existing directory ?

Rhanks a lot
Karsten