-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: Getwd returns wrong path format in MinGW #43944
Comments
Is the issue the printed path shows Because I cannot reproduce the error on msys on windows if |
@AlexRouSg @seankhliao here is how i reproduce the problem:
now try this code:
i got
my expectation would be:
thanks. |
There is nothing wrong with This is a issue of exec not being able to run programs without the cc @alexbrainman for windows |
@AlexRouSg i see. thanks. |
should this be closed as working as intended? |
@seankhliao |
maybe change the title to: |
however the |
@enihcam looks like you are using Cygwin shell. Go is not supported to run under Cygwin. If you want to run program built with Go for Windows, just use plain Windows. Alex |
Issue is not cygwin related, author had a file named |
I disagree. This code
does not produce this error message
if you run this program under cmd.exe. I am guessing here. If you really want my help. I need proper repro (step by step instructions on how to reproduce this issue), not bits of code and bits of error message. Alex |
code:
cmd cmmands and output:
|
@AlexRouSg thanks for repro steps. I agree, that your program should be able to run without the error as per https://golang.org/pkg/os/exec/#Command
I don't agree or disagree with documentation. But that is how I read the documentation. But real code also applies PATHEXT matches to your path before accepting it. That is why it fails. I am not sure what should be done here. Perhaps we can relax this scenario to execute file path if it exists. Alex |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
run
exec.Command(filepath.Join(os.Getwd(), 'app')
under:What did you expect to see?
app output
What did you see instead?
exec: "C:\\Users\\guest\\app": file does not exist
The text was updated successfully, but these errors were encountered: