Re: [racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Peter W A Wood
Many thanks Philip The resulting code is much neater and, to me, more readable: (define-runtime-path foo.txt "foo.txt") (define-runtime-path bar.txt "bar.txt") (define-runtime-path outfile.txt "outfile.txt") (define-runtime-path Data/portfolio.csv "../../Data/portfolio.csv") (define-runtime-path

Re: [racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Philip McGrath
For this particular purpose, you want `define-runtime-path`: https://docs.racket-lang.org/reference/Filesystem.html#%28part._runtime-path%29 -Philip On Mon, Jul 27, 2020 at 9:38 PM Peter W A Wood wrote: > I have a short racket program/script that reads a file from the directory > in which it

[racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Peter W A Wood
I have a short racket program/script that reads a file from the directory in which it is stored. The directory structure is something like this: a/ b/ c/ my-racket.rkt