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
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
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
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
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
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
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
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
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 < "
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.
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
11 matches
Mail list logo