Skip to content

fopen($path, 'x') should not succeed when called twice #16

Description

@0b10011

The x mode for fopen() should fail when called twice, as the first call should create the file.

$a = fopen('fs://test.flag', 'x');
$b = fopen('fs://test.flag', 'x');
if (is_resource($a)) {
    echo 'a';
    fclose($a);
}
if (is_resource($b)) {
    echo 'b';
    fclose($b);
}

Expected result:

a

fopen(): failed to open stream: File exists

Actual result:

ab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions