Is this a bug?
I found this working on reading a different file in /proc but this is a shorter example to demonstrate.
So this code doesn’t do what I expect (this is on mint linux with ‘odin version dev-2025-11-nightly’
package main
import "core:fmt"
import "core:os"
main :: proc() {
file_contents, ok := os.read_entire_file("/proc/cpuinfo")
if !ok do panic("Unable to read /proc/cpuinfo")
fmt.println(file_contents)
}
It returns success but the contents is an empty slice of bytes. it works for normal files but fails for anything I’ve tested in /proc
I understand that files in /proc are not normal files, but I can’t imagine it’s intended that this returns success but doesn’t actually do what it ought to?
os is soon to be replaced by os2. I think I saw a post in these forums about Q1 of 2026. Most of the OS work is being done there I think. Try this below. It works for me. Add your own error checking as needed.