You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt"
"os"
)
func main() {
// 3.9 GB (4135698432 bytes)
file := "/home/peter/ubuntu-9.10-dvd-i386.iso"
flags := os.O_RDONLY
perm := 0666
in, err := os.Open(file, flags, perm)
if err != nil {
fmt.Println(file, err.String())
}
in.Close()
}
Go 40ce831c5918+ tip. Linux Ubuntu 9.10 386 32-bit.
The program fails to open the file if the file size is greater than or
equal to 2^31 bytes. strace shows:
open("/home/peter/ubuntu-9.10-dvd-i386.iso", O_RDONLY|O_CLOEXEC) = -1
EOVERFLOW (Value too large for defined data type).
If flags = flags | O_LARGEFILE the program opens the file.
The ioutil.ReadFile() implicit file open also fails for the same reason.
Go 9cf4bce3ad75+ tip. Linux Ubuntu 9.10 amd64 64-bit.
Program opens the file.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: