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

File paths are always relative to the current directory unlike folders #77

Open
NotWearingPants opened this issue Sep 25, 2021 · 0 comments

Comments

@NotWearingPants
Copy link

Reproduction:

Create the following file structure:

a/
    b/
    c.txt

And run the following testcases inside the a/ folder:

glob('../a/*') //=> ['../a/b', 'c.txt']
glob('b/../*') //=> ['b', 'c.txt']
glob('/absolute/path/to/a/*') //=> ['/absolute/path/to/a/b', 'c.txt']

The paths to files are always relative to the current directory, while the paths to folders are somewhat faithful to the glob input.

I think the correct form is to stay faithful to the input, but whatever the choice is the inconsistencies are a problem.

I also think it's weird that even for folders b/.. resolves to nothing while ../a stays as-is, but it kinda makes sense since for the latter you need to know the current folder is a.

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

1 participant