summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-10-29 04:39:33 +0000
committerTim Potter <tpot@samba.org>2002-10-29 04:39:33 +0000
commit64c6fd21c1c176ec3c97a93fdf3d5bdaa2edb711 (patch)
treea574ca61df3ae1668f9f3f1c7ff80bcdf75fba68 /source3/python
parent608985f7ea1648142872983631e209443c0e76f6 (diff)
downloadsamba-64c6fd21c1c176ec3c97a93fdf3d5bdaa2edb711.tar.gz
samba-64c6fd21c1c176ec3c97a93fdf3d5bdaa2edb711.tar.bz2
samba-64c6fd21c1c176ec3c97a93fdf3d5bdaa2edb711.zip
Added close and unlink functions.
(This used to be commit 3a7f8a568e9d1608c2a065e0b98488e2d068911c)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_smb.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c
index 85f7792047..0936826488 100644
--- a/source3/python/py_smb.c
+++ b/source3/python/py_smb.c
@@ -179,6 +179,44 @@ static PyObject *py_smb_nt_create_andx(PyObject *self, PyObject *args,
return PyInt_FromLong(result);
}
+static PyObject *py_smb_close(PyObject *self, PyObject *args,
+ PyObject *kw)
+{
+ cli_state_object *cli = (cli_state_object *)self;
+ static char *kwlist[] = { "fnum", NULL };
+ BOOL result;
+ int fnum;
+
+ /* Parse parameters */
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "i", kwlist, &fnum))
+ return NULL;
+
+ result = cli_close(cli->cli, fnum);
+
+ return PyInt_FromLong(result);
+}
+
+static PyObject *py_smb_unlink(PyObject *self, PyObject *args,
+ PyObject *kw)
+{
+ cli_state_object *cli = (cli_state_object *)self;
+ static char *kwlist[] = { "filename", NULL };
+ char *filename;
+ BOOL result;
+
+ /* Parse parameters */
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "s", kwlist, &filename))
+ return NULL;
+
+ result = cli_unlink(cli->cli, filename);
+
+ return PyInt_FromLong(result);
+}
+
static PyObject *py_smb_query_secdesc(PyObject *self, PyObject *args,
PyObject *kw)
{
@@ -279,6 +317,12 @@ static PyMethodDef smb_hnd_methods[] = {
{ "nt_create_andx", (PyCFunction)py_smb_nt_create_andx,
METH_VARARGS | METH_KEYWORDS, "NT Create&X" },
+ { "close", (PyCFunction)py_smb_close,
+ METH_VARARGS | METH_KEYWORDS, "Close" },
+
+ { "unlink", (PyCFunction)py_smb_unlink,
+ METH_VARARGS | METH_KEYWORDS, "Unlink" },
+
/* Security descriptors */
{ "query_secdesc", (PyCFunction)py_smb_query_secdesc,