8000 fixed running cli app over files in racket snippet · jestarray/notes@84ab210 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84ab210

Browse files
authored
fixed running cli app over files in racket snippet
1 parent 3cc51fb commit 84ab210

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,20 @@ but given how it says "0MB/s" I think it's unlikely to be the culprit...
135135
in either case: if your laptop is part of a corporate network (for instance from a school) it could be your IT department being inexperienced
136136
there are certain settings you can make that cause extremely expensive and intrusive AV scanning (and they're better left disabled)
137137

138-
## Run cli programs with racket:
138+
## Run files over a cli program with racket:
139139
```scheme
140140
#lang racket
141141
142142
(define curr-dir (current-directory))
143-
144143
(define files
145144
(filter
146145
(lambda (path)
147146
(define ext (path-get-extension path))
147+
;(println ext)
148148
(cond
149149
[(boolean? ext) #f]
150-
[(bytes=? ext #".pdf") #t]))
150+
[else
151+
(bytes=? ext #".json")]))
151152
(directory-list curr-dir)))
152153
153154
(println files)
@@ -161,7 +162,7 @@ there are certain settings you can make that cause extremely expensive and intru
161162
[(boolean? ext) (path->string p)]
162163
[else
163164
(substring str 0 (- (string-length str) (bytes-length ext)))]))
164-
165+
#;
165166
(for
166167
([p files])
167168
(define file (path->string p))

0 commit comments

Comments
 (0)
0