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

escaping the \ character in the file path #16

Open
SQLServerIO opened this issue Sep 15, 2017 · 5 comments
Open

escaping the \ character in the file path #16

SQLServerIO opened this issue Sep 15, 2017 · 5 comments

Comments

@SQLServerIO
Copy link

On Windows the file paths are normally \ and not / and when you include a directory it generates code that will not build.

My example:
go-bindata -ignore=\*.bak -o assets.go scripts\

in my assets.go file I end up with scripts\file name and that throws an error due to the unescaped
in release.go the offending line is
info := bindataFileInfo{name: %q, size: %d, mode: os.FileMode(%d), modTime: time.Unix(%d, 0)}
I'm assuming that %q needs to be sanitized.

@shuLhan shuLhan added the bug label Sep 15, 2017
@shuLhan
Copy link
Owner

shuLhan commented Sep 24, 2017

@SQLServerIO ,

Since I don't have Windows machine to test the output, I try to blind fix this on branch dev-shulhan. Can you give it a try?

@RamonSmit
Copy link

Forward slash is working in Windows as well. Must not be a problem since Windows Vista

@joerocklin
Copy link
Contributor

@shuLhan You can grab a windows VM from Microsoft at https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. They're intended for browser testing, but I've not seen any restrictions on installing other software.

Windows has supported both slashes as path separators for a very long time (back in the early DOS days). The dev branch worked for me with the exception that it required a directory component for the output file:

go-bindata/config.go

Lines 226 to 231 in 4ec947e

dir, file := filepath.Split(c.Output)
err = os.MkdirAll(dir, 0700)
if err != nil {
return fmt.Errorf("Create output directory: %v", err)
}

It looks like this might be part of a new mechanism for handling the output, but it breaks the existing scenario where the output is defined to be a single file.

@shuLhan shuLhan self-assigned this Nov 7, 2017
@shuLhan
Copy link
Owner

shuLhan commented Nov 7, 2017

@SQLServerIO,

I have installed Windows in virtual machine just to test and try to fix this bug but I can't reproduce it. Can you give more information about error message, list of files in your scripts directory, version of Go, version go-bindata that you were using? Thank you.

shuLhan added a commit that referenced this issue Nov 7, 2017
shuLhan added a commit that referenced this issue Nov 7, 2017
@shuLhan shuLhan added the windows label Jan 2, 2018
@shuLhan shuLhan added needs feedback and removed bug labels Mar 2, 2018
@shuLhan
Copy link
Owner

shuLhan commented Mar 2, 2018

@SQLServerIO Can you please try again with latest version. Thank you.

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

No branches or pull requests

4 participants