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

os: Truncate() on a non existent file produces error with typo #7255

Closed
gopherbot opened this issue Feb 3, 2014 · 3 comments
Closed

os: Truncate() on a non existent file produces error with typo #7255

gopherbot opened this issue Feb 3, 2014 · 3 comments

Comments

@gopherbot
Copy link

by abel@rewardstyle.com:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Try truncating a file that doesn't exist


What is the expected output?
truncate file=/path/to/file: no such file or directory

What do you see instead?
truncate ile=/path/to/file: no such file or directory

Which compiler are you using (5g, 6g, 8g, gccgo)?


Which operating system are you using?
Mac OSX Mountain Lion

Which version are you using?  (run 'go version')
1.1.2

Please provide any additional information below.

Just a typo in the error message...
@davecheney
Copy link
Contributor

Comment 1:

I am not able to reproduce the issue
lucky(~/src) % cat truncate.go 
package main
import "fmt"
import "os"
func main() {
        fmt.Println(os.Truncate("/yolo", 0))
}
# linux
lucky(~/src) % go run truncate.go
truncate /yolo: no such file or directory
# osx mountain lion
odessa(~/src) % go run truncate.go 
truncate /yolo: no such file or directory
Can you please update to Go 1.2 and try again, this issue may have already been fixed.

Labels changed: added repo-main.

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 3 by abel@rewardstyle.com:

In walking back through this to see why it isn't reproducible, I found that the file
path was being incorrectly parsed (i.e. the ile= was coming from inside the program). My
apologies for that.
Cheers,
Abel

@davecheney
Copy link
Contributor

Comment 4:

No problems.

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants