Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сontroversial processing of path argument in files api #245

Open
pyhedgehog opened this issue May 30, 2016 · 1 comment
Open

Сontroversial processing of path argument in files api #245

pyhedgehog opened this issue May 30, 2016 · 1 comment

Comments

@pyhedgehog
Copy link

File filename is different than /filename.
File filename is different than ./filename but has same "dirname" and "relative" fields.
Only /filename can be found by any readdir command.

$ python2.7 -m hookio files writeFile /test1.txt 111
{
  "basename": "test1.txt",
  "contents": null,
  "dirname": "/",
  "extname": ".txt",
  "path": "/test1.txt",
  "relative": "test1.txt",
  "stem": "test1"
}
$ python2.7 -m hookio files writeFile test1.txt 222
{
  "basename": "test1.txt",
  "contents": null,
  "dirname": ".",
  "extname": ".txt",
  "path": "test1.txt",
  "relative": "root/deployed/hook.io/test1.txt",
  "stem": "test1"
}
$ python2.7 -m hookio files readFile /test1.txt
{
  "basename": "test1.txt",
  "contents": "111",
  "dirname": "/",
  "extname": ".txt",
  "path": "/test1.txt",
  "relative": "test1.txt",
  "stem": "test1"
}
$ python2.7 -m hookio files readFile test1.txt
{
  "basename": "test1.txt",
  "contents": "222",
  "dirname": ".",
  "extname": ".txt",
  "path": "test1.txt",
  "relative": "root/deployed/hook.io/test1.txt",
  "stem": "test1"
}
$ python2.7 -m hookio files readFile ./test1.txt
Not Found
$ python2.7 -m hookio files readdir /
[
  {
    "basename": "test1.txt",
    "contents": null,
    "dirname": "pythonsdktest/",
    "extname": ".txt",
    "path": "pythonsdktest//test1.txt",
    "relative": "root/deployed/hook.io/pythonsdktest/test1.txt",
    "stem": "test1"
  }
]
$ python2.7 -m hookio files readdir .
[]
@Marak
Copy link
Collaborator

Marak commented Oct 17, 2017

@pyhedgehog -

Good catch. This was a problem.

I've made several changes to https://github.com/bigcompany/hook.io-vfs/blob/master/lib/vfs.js that I hope will resolve this issue. I've also added new test cases to cover the the cases mentioned above.

Everything is deployed as of this morning. I'll continue to test. Please let me know if it's working better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants