Skip to content

uv_last_error always returns 0, even when mkdir fails #28

Description

@csaoh

Here is my code

<?php

uv_fs_mkdir(uv_default_loop(), "test",
            UV::O_CREAT | UV::S_IRWXU | UV::S_IRUSR,
            function($r){
              if ($r === -1) {
                echo uv_last_error() . "\n";
                return;
              }
              echo "ok\n";
            });

uv_run();

When i run it without having a "test" directory within my current directory, it displays "ok", but if I re-run it the second time, mkdir fails (as expected), but the error code is 0. Is it a bug or am I doing something wrong ?

> ll
total 8
-rw-r--r--  1 andrey  staff  848 30 jan 15:59 script.php
> php script.php 
ok
> php script.php 
0

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