Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv_last_error always returns 0, even when mkdir fails #28

Open
csaoh opened this issue Jan 30, 2013 · 2 comments
Open

uv_last_error always returns 0, even when mkdir fails #28

csaoh opened this issue Jan 30, 2013 · 2 comments

Comments

@csaoh
Copy link
Contributor

csaoh commented Jan 30, 2013

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
@chobie
Copy link
Owner

chobie commented Jan 31, 2013

maybe this will solve when I update libuv version as uv_fs_* functions does not set error code.
I will check in the 2nd week of February this problem.

Thanks

@steverhoades
Copy link

FYI - uv_last_error has been removed from libuv 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants