joyent / libuv

Go to
https://github.com/libuv/libuv
3.27k stars 653 forks source link

Document uv_fs_access better #1560

Closed creationix closed 10 years ago

creationix commented 10 years ago

The docs leave much to be desired and are misleading. The second arg should be called amode or mode to line up with what's in the man page (currently it's flags which is a 4th arg to the long-form in the linux man page that is unrelated). Also it appears through testing that the only non-error result is 0 and all other results are uv errors. This is fine behavior, but it's taken me a while to figure out how this works or what it's even for.

saghul commented 10 years ago

Hi Tim! I fixed the parameter name in e03c0c7. As for the return code, same rule as any other libuv function applies, as documented: < 0 means error, success otherwise (which is usually 0).