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: File.Seek does not work past EOF on NaCl #21728

Open
dsnet opened this Issue Sep 1, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@dsnet
Member

dsnet commented Sep 1, 2017

Consider the following snippet:

f, err := ioutil.TempFile("", "")
if err != nil {
	log.Fatal(err)
}
// f.Truncate(1000)
if _, err := f.Seek(1000, io.SeekCurrent); err != nil {
	log.Fatal(err)
}

On NaCl, this current fails with:

seek /tmp/054003078: Invalid argument

If you uncomment the Truncate, then it works again. This is contrary to every other OS that Go supports, where you can seek past EOF and start writing and everything in-between is implicitly filled with zeros.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot Dec 7, 2017

Change https://golang.org/cl/82535 mentions this issue: syscall: make Seek use SetFilePointerEx on Windows, allowing large seek offsets

gopherbot commented Dec 7, 2017

Change https://golang.org/cl/82535 mentions this issue: syscall: make Seek use SetFilePointerEx on Windows, allowing large seek offsets

gopherbot pushed a commit that referenced this issue Dec 7, 2017

syscall: make Seek use SetFilePointerEx on Windows, allowing large se…
…ek offsets

Fixes #21681
Updates #21728

Change-Id: I79cf4564c1355ecab891102d4215cbbffd8eb0ce
Reviewed-on: https://go-review.googlesource.com/82535
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment