这是indexloc提供的服务,不要输入任何密码
Skip to content

core:os package read_entire_file_xxx procedures don't work on /proc filesystem even if on a Linux system #4264

@edyu

Description

@edyu

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

        Odin:    dev-2024-09:8814170ed
        OS:      Ubuntu 24.04.1 LTS, Linux 5.15.153.1-microsoft-standard-WSL2
        CPU:     AMD Ryzen 7 5800HS with Radeon Graphics
        RAM:     11662 MiB
        Backend: LLVM 18.1.3

Expected Behavior

os.read_entire_file and fellow procedures should be able to read /proc files such as /proc/meminfo.

Current Behavior

os.read_entire_file procedures don't return error but will only return an empty slice.

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

    data := os.read_entire_file_or_err("/proc/meminfo) or_return
    defer delete(data)
    fmt.println(data)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions