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

Path:hasextension always returns true #2407

Open
Garek33 opened this issue Jan 13, 2019 · 3 comments
Open

Path:hasextension always returns true #2407

Garek33 opened this issue Jan 13, 2019 · 3 comments

Comments

@Garek33
Copy link

Garek33 commented Jan 13, 2019

Let's say there we have the following folder structure:

  • <Archive Root>
    • kmos
      • base
        • kmos.ks

Enviroment

  • KSP 1.6 (I know it's not offically supported yet, but kOS seems to work in principle, and I don't expect KSP to break file system access...)
  • Windows 10
  • kOS should be equivalent to develop for this, actually build from Garek33:dev-2394 (up-to-date with develop, plus Fix #2394 - Expose terminal cursor #2397 )

Expected Behaviour

  • path("kmos/base"):hasextension returns false
  • path("kmos/base/kmos"):hasextension returns false
  • path("kmos/base/kmos.ks"):hasextension returns true

Tested Behaviour

  • path("kmos/base"):hasextension returns true
  • path("kmos/base/kmos"):hasextension returns true
  • path("kmos/base/kmos.ks"):hasextension returns true
@Garek33
Copy link
Author

Garek33 commented Jan 13, 2019

(Obviously, this is in no way urgent, because as long as you don't have filenames ending with . (and then, what are you even doing?) one can work around this by checking path:extension = "" instead)

@mathuin
Copy link
Contributor

mathuin commented Jan 13, 2019

On Linux, I'm getting something different:

  • path("boot"):hasextension returns True.
  • path("boot/boot.ks"):hasextension returns False.
  • runpath("boot/boot.ks"). executes the script at that location successfully.

@Garek33
Copy link
Author

Garek33 commented Jan 13, 2019

  • path("boot"):hasextension returns True.
  • path("boot/boot.ks"):hasextension returns False.

Interesting

  • runpath("boot/boot.ks"). executes the script at that location successfully.

runpath works for me, too. Even when leaving the extension out, as the docs offer.

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