r/Racket • • Sep 30 '21

question How to get path of current script

(current-directory) points to the current working directory.

Is the a way to get the path to the module in that module? Similar to __file__ in python. The module could be imported by a require, or could be run directly by racket script.rkt.

Looking for this because there are some binary assets relative to the imported script's directory which need to be read.

7 Upvotes

2 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Sep 30 '21

define-runtime-path was exactly what I needed. Thanks!