Name Date Size #Lines LOC

..--

CMakeLists.txtH A D25-Apr-2025890 4137

README.mdH A D25-Apr-20251.2 KiB2420

helloworld.ccH A D25-Apr-20252.5 KiB9155

idle-basic.ccH A D25-Apr-20253.4 KiB11772

uvcat.ccH A D25-Apr-20253.3 KiB11573

README.md

1# LibUV Sandbox Examples
2
3Each example in this folder is the sandboxed version of a code snippet from
4[LibUV's User Guide](https://docs.libuv.org/en/v1.x/guide.html). These examples
5perform some basic tasks using LibUV, and can be useful both to understand how
6to use LibUV Sandbox, but also to get an idea of how regular and sandboxed code
7compare to each other.
8
9This is the list of examples:
10
11- **helloworld.cc**: sandboxed version of
12[helloworld/main.c](https://docs.libuv.org/en/v1.x/guide/basics.html#hello-world).
13It simply starts a loop that exits immediately. It shows how to run a simple
14loop in LibUV Sandbox.
15- **idle-basic.cc**: sandboxed version of
16[idle-basic/main.c](https://docs.libuv.org/en/v1.x/guide/basics.html#handles-and-requests).
17Creates an idle watcher that stops the loop after a certain number of
18iterations. It shows how a simple callback can be used in LibUV Sandbox.
19- **uvcat.cc**: sandboxed version of
20[uvcat/main.c](http://docs.libuv.org/en/v1.x/guide/filesystem.html#reading-writing-files).
21Takes a single argument, the absolute path of a file, and prints its contents
22(it is a simplified version of the command line tootl `cat`). It shows how to
23manage various complex callbacks for opening, reading and writing files.
24