Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-20 Thread David Storrs
On Fri, Jan 20, 2017 at 10:02 AM, Robby Findler wrote: > On Thu, Jan 19, 2017 at 7:29 PM, David Storrs wrote: >> On Thu, Jan 19, 2017 at 6:45 PM, Robby Findler >> wrote: >>> In DrRacet, current-directory in

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-20 Thread Robby Findler
On Thu, Jan 19, 2017 at 7:29 PM, David Storrs wrote: > On Thu, Jan 19, 2017 at 6:45 PM, Robby Findler > wrote: >> In DrRacet, current-directory in initialized to the directory >> containing the file where you hit "Run" and in the shell it is

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
On Thu, Jan 19, 2017 at 6:45 PM, Robby Findler wrote: > In DrRacet, current-directory in initialized to the directory > containing the file where you hit "Run" and in the shell it is > initialized to the current directory as understood by the shell. > > Is that what

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
Assuming I understand it correctly, I think the problem in the original is that, in Dr. Racket, (find-system-path 'run-file) returns the path of Dr. Racket, whereas at the shell it returns the path of the file being run. It's a hack, but I think you could make a quick and dirty solution to

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Robby Findler
In DrRacet, current-directory in initialized to the directory containing the file where you hit "Run" and in the shell it is initialized to the current directory as understood by the shell. Is that what you're asking? Robby On Thu, Jan 19, 2017 at 4:36 PM, David Storrs

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
Not the question you asked, but instead of with-output-to-string, if you're discarding the output, you might prefer: (parameterize ([current-output-port (open-output-nowhere)]) ...) -Philip On Thu, Jan 19, 2017 at 4:51 PM, Philip McGrath wrote: > I haven't looked

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
I haven't looked in detail, but two quick thoughts: - When I evaluate (find-system-path 'run-file) in Dr. Racket, either inside a module or in the REPL, I get # - Have you looked at (current-directory)? In Dr. Racket, if the file has been saved, that returns the path to the directory

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
For the record, I know I can pass an absolute path (defined with define-runtime-path) to load-initial-data. My question is more about "why is this different between the shell and Dr Racket?" On Thu, Jan 19, 2017 at 5:23 PM, David Storrs wrote: > define-runtime-path is

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
define-runtime-path is based on the enclosing file, not the running file. ;; file: app/lib/db/initial_test_data.sql ...various SQL commands... ;; file: app/lib/t/testing_utils.rkt (define-runtime-path thisdir ".") (define cmd (string-append "psql -d biomantica < "

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Robby Findler
define-runtime-path is designed for this problem, IIUC. Let me know if the docs don't help. Robby On Thu, Jan 19, 2017 at 11:47 AM, David Storrs wrote: > Short form: When using Dr Racket, how do I write something that says > "Here is a path to a file that I care about.

[racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
Short form: When using Dr Racket, how do I write something that says "Here is a path to a file that I care about. The path is relative to you, the script that is running the code" ? Long form: I have a file, testing_utils.rkt, that includes the following snippet of code: (define