A bit of strange behaviour

I was just doing some small stuff with racket, was looking through files on a nas.
The thing I found strange was

In drracket
I was trying

(define root "/some/dir/that/exists/with/files/and/folders")
(define files (directory-list root))
(for/list ([f files])
(if (directory-exists? f)
this branch won't run
this branch will run)

the same happens if I use file-exists?
however if I do it not on the nas (cifs), on the local file system (ext4) it behaves as expected.
I think it might be something with a different file system, not that I really know.

You must use (directory-list root #:build? #t) to get the complete path instead just the name of the file/directory.

#lang racket
(define root "/some/dir/that/exists/with/files/and/folders")
(define files (directory-list root #:build? #t))
(for ([f files])
  (display f)
  (if (directory-exists? f)
      (displayln " --> Yes")
      (displayln " --> No")))

Ah I just tested it on a single file in my directory, not the same for/list construct. Thanks will test this :slight_smile: