UV-Shell
libuv で遊ぶ(Play around libuv)
IIJ 大津繁樹
2011年10月29日
#include <stdio.h> #include "uv.h" static void cb(uv_write_t* req, int status) { printf("Hello from Callback.\n"); uv_unref(uv_default_loop()); } int main() { uv_tty_t tty; // tty stream handle uv_write_t req; // write request int ret = uv_tty_init(uv_default_loop(), &tty, 1, 0); uv_buf_t bufs[] = { uv_buf_init("Hello UV!\n",10) }; ret = uv_write(&req, (uv_stream_t*)&tty, bufs, 1, cb); uv_run(uv_default_loop()); return 0; }
uv% uvtouch a.txt { uvcp a.txt b.txt { uvls }} b.txt a.txt
unix:~/tmp/github/node> git log --reverse commit 9d7895c567e8f38abfff35da1b6d6d6a0a06f9aa Author: Ryan <ry@tinyclouds.org> Date: Mon Feb 16 01:02:00 2009 +0100 add dependencies