diff options
Diffstat (limited to 'python/guestfs-py.c')
-rw-r--r-- | python/guestfs-py.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 59a891ff..ac1283be 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -4853,6 +4853,30 @@ py_guestfs_df_h (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_du (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int64_t r; + const char *path; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_du", + &py_g, &path)) + return NULL; + g = get_handle (py_g); + + r = guestfs_du (g, path); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyLong_FromLongLong (r); + return py_r; +} + static PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -5034,6 +5058,7 @@ static PyMethodDef methods[] = { { (char *) "tail_n", py_guestfs_tail_n, METH_VARARGS, NULL }, { (char *) "df", py_guestfs_df, METH_VARARGS, NULL }, { (char *) "df_h", py_guestfs_df_h, METH_VARARGS, NULL }, + { (char *) "du", py_guestfs_du, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; |