tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
morte_ has joined #racket
morte_ is now known as morte
Origin has quit [Quit: Leaving]
Achylles has quit [Remote host closed the connection]
CodeSpelunker has joined #racket
morte has quit [Remote host closed the connection]
CodeSpelunker has quit [Ping timeout: 256 seconds]
lucasta has quit [Remote host closed the connection]
CodeSpelunker has joined #racket
morte_ has joined #racket
morte_ has quit [Ping timeout: 240 seconds]
CodeSpelunker has quit [Quit: CodeSpelunker]
skapata has quit [Ping timeout: 265 seconds]
skapata has joined #racket
shawnw has joined #racket
ormaaaj has quit [Ping timeout: 240 seconds]
ormaaaj has joined #racket
ormaaaj has quit [Ping timeout: 248 seconds]
ormaaaj has joined #racket
sleepy_mecha has joined #racket
skapata has quit [Remote host closed the connection]
avocadoist has quit [Quit: Konversation terminated!]
avocadoist has joined #racket
avocadoist has quit [Quit: Konversation terminated!]
avocadoist has joined #racket
avocadoist has quit [Read error: Connection reset by peer]
avocadoist has joined #racket
avocadoist has quit [Quit: Konversation terminated!]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Read error: Connection reset by peer]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Read error: Connection reset by peer]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
avocadoist has quit [Client Quit]
avocadoist has joined #racket
mwnaylor has joined #racket
runrin has quit [Ping timeout: 250 seconds]
jeosol has quit [Quit: Client closed]
mwnaylor has quit [Ping timeout: 240 seconds]
micro has quit [Remote host closed the connection]
micro has joined #racket
lucasta has joined #racket
Inst has joined #racket
skapata has joined #racket
jeosol has joined #racket
undltd has quit [Quit: You have been kicked for being idle]
morte_ has joined #racket
Tuplanolla has joined #racket
jeosol has quit [Quit: Client closed]
lowak has joined #racket
sleepy_mecha has quit [Quit: Leaving]
morte_ has quit [Ping timeout: 260 seconds]
cwebber has quit [Remote host closed the connection]
scubagear has quit [Read error: Connection reset by peer]
skapata has quit [Quit: Bonan tageron kaj ĝis la.]
morte_ has joined #racket
cwebber has joined #racket
mwnaylor has joined #racket
scubagear has joined #racket
<mwnaylor> If I have path value, how can I test it to see if it is a file or directory?
<samth> mwnaylor: `directory-exists?`
<mwnaylor> Seems like there is a weakness there. (map directory-exists? (directory-list "..")) yields a list of all #f, not a #t there.
<mwnaylor> I think there should be at least one #t, since the current directory is contained by the parent directory.
<samth> mwnaylor: `directory-list` does not produce `.` and `..` in that example
<samth> sorry, that's not what you asked
<samth> the problem there is that there's a confusion about current directories -- `directory-list` does not produce absolute paths
<Tuplanolla> You have a race condition on your hands if you ever find yourself asking that question.
<Tuplanolla> Try to read the path as a file or as a directory, and handle the failure if it occurs.
<mwnaylor> How does the race condition occur?
<mwnaylor> (directory-exists? (path->complete-path "~")) -> #f
<samth> mwnaylor: ~ expansion is something your shell does
<Tuplanolla> The directory may vanish between asking whether it exists (or whether it is a directory) and accessing it.
<mwnaylor> samth: I figured that out. Still, after retrieving the contents of a directory with directory list on an absolute path, directory-exists? returns #f for every item, including the subdirectories.
<samth> mwnaylor: you're still getting confused about the current directory
<samth> mwnaylor: you want (map directory-exists? (map path->complete-path (map (lambda (e) (build-path ".." e)) (directory-list ".."))))
<mwnaylor> (directory-exists? "/home/mwnaylor")
scubagear has left #racket [#racket]
<mwnaylor> That returns #t. But (map directory-exists? (directory-list "/home/mwnaylor")) yields #f for every item.
<samth> mwnaylor: right, because `directory-list` does not produce absolute paths
<samth> and your current directory is not `/home/mwnaylor`
morte_ has quit [Remote host closed the connection]
lucasta has quit [Remote host closed the connection]
<mwnaylor> Thanks for the help. Seems a bit clumsy to need the build-path step to get the absolute, but now I know it's a requiered step.
<mwnaylor> BTw, is there a directory-tree function? Something like directory-list, but would recurse into subdirectories?
<mwnaylor> I should have been using this form: (directory-list <path-or-string> #:build? #t)
cwebber has quit [Remote host closed the connection]
Tuplanolla has quit [Quit: Leaving.]