Skip to content

LockingTextWriter silently drops fputc/fputwc errors #11005

@CyberShadow

Description

@CyberShadow

Looks like we are silently discarding errors in LockingTextWriter.put:

import std.stdio;

void main()
{
    auto f = File("/dev/full", "w");
    f.setvbuf(0, _IONBF);
    auto w = f.lockingTextWriter();

    try
    {
        foreach (c; "hello world")
            w.put(c);
        writeln("silent: write loop completed without error");
    }
    catch (Exception e)
    {
        writeln("THREW: ", typeid(e), ": ", e.msg);
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions