[racket] How to get current directory in the module file?

From: Haiwei Zhou (highfly22 at gmail.com)
Date: Fri Dec 14 02:55:56 EST 2012

Hi,

For example, I have two module a and other-directory/b

a.rkt
----- begin of file ---

#lang racket

(define cwd (current-directory))

(provide cwd)

------- end of file ----

other-directory/b.rkt
---- begin ---
#lang racket

(require "a.rkt)

(print cwd)
---- end ---

To execute racket b.rkt, it will print "other-directory" instead of the
directory of a.rkt.

How to get the directory of a.rkt?


Thanks,
Haiwei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121214/ef8a4f52/attachment.html>

Posted on the users mailing list.