Ejemplo n.º 1
0
int SmbFs::fs_unlink(const char *path)
{
	QMutexLocker locker(&_mutex);
	
	if((smbc_getFunctionUnlink(_ctx))(_ctx, qPrintable(getPath(path))) == 0)
		return(0);
	else
		return(-errno);
}
Ejemplo n.º 2
0
int
smbc_creat(const char *furl,
           mode_t mode)
{
	SMBCFILE * file;
	int fd;
        
        file = smbc_getFunctionCreat(statcont)(statcont, furl, mode);
	if (!file)
		return -1;
        
	fd = add_fd(file);
	if (fd == -1) {
		/* Hmm... should we delete the file too ? I guess we could try */
                smbc_getFunctionClose(statcont)(statcont, file);
                smbc_getFunctionUnlink(statcont)(statcont, furl);
	}
	return fd;
}
Ejemplo n.º 3
0
static PyObject *
Context_unlink (Context *self, PyObject *args)
{
  int ret;
  char *uri = NULL;
  smbc_unlink_fn fn;

  if(!PyArg_ParseTuple (args, "s", &uri))
    {
      return NULL;
    }

  fn = smbc_getFunctionUnlink (self->context);
  errno = 0;
  ret = (*fn) (self->context, uri);
  if (ret < 0)
    {
      pysmbc_SetFromErrno ();
      return NULL;
    }

  return PyLong_FromLong (ret);
}
Ejemplo n.º 4
0
int
smbc_unlink(const char *fname)
{
        return smbc_getFunctionUnlink(statcont)(statcont, fname);
}