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

Expose path cleaning #1

Open
cppforlife opened this issue Feb 15, 2017 · 1 comment
Open

Expose path cleaning #1

cppforlife opened this issue Feb 15, 2017 · 1 comment

Comments

@cppforlife
Copy link

@charlievieth what do you think about exposing some kind of function (absPath) to resolve paths so that generic code that works on windows/unix doesnt have to do cleaning? Here is an example PR that includes cleaning functionality:

cloudfoundry/bosh-utils#11

@charlievieth
Copy link
Owner

charlievieth commented Feb 16, 2017

I do not believe this can be done as the Windows versions of posix utilities differ in what paths they accept. PR #11 works with the tar included with git-bash, but breaks the tar included with cygwin and libarchive, which properly handles Windows paths. For example path C:\Windows is represented in: git-tar as /c/windows; and cygwin-tar as /cygdrive/c/windows.

That said, I've been debating exposing absPath, but I'm not sure how valuable it would be, as outside of the os package, which fs fully replicates, the most common situation in which MAX_PATH is violated is when walking directories and absPath does not know if a path will be walked. To handle this issue I do plan to add implement filepath.Walk with support for long paths in the fs package.

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