Skip to content

getRelativePath query #54

@JonnyPtn

Description

@JonnyPtn

I've noticed when using xy::Filesystem::getRelativePath() that the input has to be correctly formatted to get the expected results (unless my expectations are wrong... which I wouldn't rule out)

Say there's a file at /some/file/path/file.thing, I'd expect the relative path to the be the same when given these three "root" paths:

  1. /some/file/otherpath
  2. /some/file/otherpath/
  3. /some/file/otherpath/otherfile.thing

However 2 & 3 both return an extra directory higher (e.g. ../../path/file.thing instead of ../path/file.thing)

I could understand if 3 was left as it is, but I'd think 1 & 2 should return the same?

Slightly related to this - getFilePath() returns the directory path including the final /, so depending on your thoughts on this issue I'd maybe request to change that too, so it can be used as such: getRelativePath(somePath, getFilePath(rootFile))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions