staticRead and staticExec have different working directories #4871

Closed
flyx opened this Issue Oct 9, 2016 · 0 comments

Projects

None yet

1 participant

@flyx
Contributor
flyx commented Oct 9, 2016 edited

Given the following directory structure:

  • folder
    • code.nim
    • test.txt
  • test.txt

With the following file content:

folder/code.nim

static:
  echo staticExec("pwd")
  echo staticRead("test.txt")

folder/test.txt

child

test.txt

parent

I execute at the root directory:

nim c folder/code.nim

And the output is:

/Users/flyx/Projects/NimYAML                                                                                                                                                                                
child

So, staticExec uses the current working directory, while staticRead uses the source file's location. This is inconsistent (and undocumented) and should be fixed one way or the other.

@flyx flyx referenced this issue Oct 9, 2016
Closed

Fixes #1994 #4874

@Araq Araq pushed a commit that closed this issue Oct 24, 2016
@flyx flyx Fixes #4871 39f03d8
@Araq Araq closed this in 39f03d8 Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment