This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 48 · Nov 24 – 30, 2025

syscall: add Open O_* flags for Windows FILE_FLAG_* flags

Worth knowingstdlib

What changed
New constants O_FILE_FLAG_* are added to golang.org/x/sys/windows, and syscall.Open on Windows accepts these flags and returns an error if unrecognized bits are supplied.
Production impact
The source does not say.
Try it
Use syscall.Open with O_FILE_FLAG_DELETE_ON_CLOSE on Windows and observe the flag is passed to the OS.
Source
github.com/golang/go/issues/73676

Understand it, then run it

Run it now

Todaygo
// This program demonstrates the current limitation on Windows: the
// syscall package does not expose O_OVERLAPPED (or any FILE_FLAG_*
// flags) and therefore os.Open cannot open a file for overlapped I/O.
// Running this on Windows will simply open the file in the default
// mode and print any error that occurs.  The change described in the
// issue would allow passing O_OVERLAPPED to syscall.Open, but that
// constant is not available in Go 1.27.1.

package main

import (
	"fmt"
	"syscall"
)

func main() {
	// Attempt to open a file with the default read-only flag.
	// On Windows this will not request overlapped I/O.
	fd, err := syscall.Open("example.txt", syscall.O_RDONLY, 0)
	if err != nil {
		fmt.Printf("open error: %v\n", err)
		return
	}
	defer syscall.Close(fd)
	fmt.Println("file opened successfully (no overlapped flag available)")
}

What it printed when we ran it on Go 1.27.1

open error: no such file or directory

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed