Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
CMakeLists.txt | H A D | 25-Apr-2025 | 890 | 41 | 37 | |
README.md | H A D | 25-Apr-2025 | 1.2 KiB | 24 | 20 | |
helloworld.cc | H A D | 25-Apr-2025 | 2.5 KiB | 91 | 55 | |
idle-basic.cc | H A D | 25-Apr-2025 | 3.4 KiB | 117 | 72 | |
uvcat.cc | H A D | 25-Apr-2025 | 3.3 KiB | 115 | 73 |
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