GUESTFS-ERLANG(3) - Linux manual

Erlang から libguestfs を使用する方法.

guestfs-erlang(3) Virtualization Support guestfs-erlang(3)

guestfs-erlang - Erlang から libguestfs を使用する方法

{ok, G} = guestfs:create(), ok = guestfs:add_drive_opts(G, Disk, [{format, "raw"}, {readonly, true}]), ok = guestfs:launch(G), [Device] = guestfs:list_devices(G), ok = guestfs:close(G).

This manual page documents how to call libguestfs from the Erlang programming language. This page just documents the differences from the C API and gives some examples. If you are not familiar with using libguestfs, you also need to read guestfs(3). ハ The Erlang bindings are implemented using an external program called "erl-guestfs". This program must be on the current PATH, or else you should specify the full path to the program: {ok, G} = guestfs:create(). {ok, G} = guestfs:create("/path/to/erl-guestfs"). "G" は他の関数に渡す libguestfs ハンドルです。 ハンドルを閉じるには: ok = guestfs:close(G). オ For functions that take optional arguments, the first arguments are the non-optional ones. The last argument is a list of tuples supplying the remaining optional arguments. ok = guestfs:add_drive_opts(G, Disk, [{format, "raw"}, {readonly, true}]). 最後の引数が空の一覧ならば、それを省略できます: ok = guestfs:add_drive_opts(G, Disk). 返 On success, most functions return a "Result" term (which could be a list, string, tuple etc.). If there is nothing for the function to return, then the atom "ok" is returned. エラーが発生すると、以下の組のどれかが表示されます: "{error, Msg, Errno}" これは関数からの通常のエラーを意味します。 "Msg" はエラーメッセージ(文字列)です。"Errno" は Unix エラー(整数)です。 "Errno" は 0 の可能性があります。 "guestfs_last_errno" in guestfs(3) 参照。 "{unknown, Function}" This indicates that the function you called is not known. Generally this means you are mixing "erl-guestfs" from another version of libguestfs, which you should not do. "Function" は未知の関数の名前です。 "{unknownarg, Arg}" This indicates that you called a function with optional arguments, with an unknown argument name. "Arg" は未知の引数の名前です。



guestfs(3), guestfs-examples(3), guestfs-gobject(3), guestfs-golang(3), guestfs-java(3), guestfs-lua(3), guestfs-ocaml(3), guestfs-perl(3), guestfs-python(3), guestfs-recipes(1), guestfs-ruby(3),

Richard W.M. Jones ("rjones at redhat dot com")
Copyright (C) 2011-2012 Red Hat Inc.


BUGS To get a list of bugs against libguestfs, use this link: To report a new bug against libguestfs, use this link: When reporting a bug, please supply: · The version of libguestfs. · Where you got libguestfs (eg. which Linux distro, compiled from source, etc) · Describe the bug accurately and give a way to reproduce it. · Run libguestfs-test-tool(1) and paste the complete, unedited output into the bug report.
libguestfs-1.36.13 2018-01-25 guestfs-erlang(3)
guestfs-erlang(3).txt (日本語 / Japanese)
Index English version of guestfs-erlang(3)
Go top