Created
May 11, 2010 00:31
-
-
Save orlandov/396746 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FFI = require("./ffi"); | |
| sys = require("sys"); | |
| var funcs = { | |
| "libzfs_init": ["pointer", []], | |
| "libzfs_fini": ["void", [ 'pointer' ]], | |
| "zfs_dataset_exists": ["byte", [ 'pointer', 'string', 'uint32' ]] | |
| }; | |
| libzfs = new FFI.Library("libzfs", funcs); | |
| var foo = libzfs.libzfs_init(); | |
| sys.puts("dataset exists " + libzfs.zfs_dataset_exists(foo, 'foobar', 1)); | |
| sys.puts("dataset exists " + libzfs.zfs_dataset_exists(foo, 'zfoobar', 1)) | |
| libzfs.libzfs_fini(foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment