You just have to take in account that directory-listreturns a list of all files and directories in the directory specified by path. If path is omitted, a list of files and directories in the current directory is returned.
If you need to process the files only. We can define a new procedure that only retrieves the files in a directory like this:
(require (lib"1.ss""srfi"));; to use the filter procedure
;; directory-list-files: String -> (listof String)
;; Obtains a list with the files (only) in the specified path
(define (directory-list-filespath)
(filter (lambda (v)
(file-exists? (string-appendpath"/"v)))
(directory-listpath)))
Finally, in the previous examples we used the for-each procedure, that applies a procedure to each element in a list, but returns void. If you want to return a value you may want to use the map procedure instead of for-each.