diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 12:16:08 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 12:16:08 +0100 |
commit | f47dafd23186938a22d41739d9bc695c7760b912 (patch) | |
tree | a6e5bf03a63cae2eeca269505724ae5c5ba11020 /python | |
parent | d9ea3e8d979c3ade1b21f27083788fd33fa3b1fa (diff) | |
download | libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.gz libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.xz libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.zip |
Generated code for 'equal' command.
Diffstat (limited to 'python')
-rw-r--r-- | python/guestfs-py.c | 26 | ||||
-rw-r--r-- | python/guestfs.py | 9 |
2 files changed, 35 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 6a807e3e..918e2ba0 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -3229,6 +3229,31 @@ py_guestfs_ping_daemon (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_equal (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *file1; + const char *file2; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_equal", + &py_g, &file1, &file2)) + return NULL; + g = get_handle (py_g); + + r = guestfs_equal (g, file1, file2); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyInt_FromLong ((long) r); + return py_r; +} + static PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -3345,6 +3370,7 @@ static PyMethodDef methods[] = { { (char *) "drop_caches", py_guestfs_drop_caches, METH_VARARGS, NULL }, { (char *) "dmesg", py_guestfs_dmesg, METH_VARARGS, NULL }, { (char *) "ping_daemon", py_guestfs_ping_daemon, METH_VARARGS, NULL }, + { (char *) "equal", py_guestfs_equal, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index 1596bcdb..d03a7a9d 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1242,3 +1242,12 @@ class GuestFS: """ return libguestfsmod.ping_daemon (self._o) + def equal (self, file1, file2): + u"""This compares the two files "file1" and "file2" and + returns true if their content is exactly equal, or false + otherwise. + + The external cmp(1) program is used for the comparison. + """ + return libguestfsmod.equal (self._o, file1, file2) + |