示例#1
0
static PyObject *
Context_stat (Context *self, PyObject *args)
{
  int ret;
  char *uri = NULL;
  smbc_stat_fn fn;
  struct stat st;

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

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

  return Py_BuildValue ("(IKKKIIKIII)",
			st.st_mode,
			(unsigned long long)st.st_ino,
			(unsigned long long)st.st_dev,
			(unsigned long long)st.st_nlink,
			st.st_uid,
			st.st_gid,
			st.st_size,
			st.st_atime,
			st.st_mtime,
			st.st_ctime);
}
示例#2
0
int SmbFs::fs_getattr(const char *path, struct stat *stbuf)
{
	QMutexLocker locker(&_mutex);
	
	if((smbc_getFunctionStat(_ctx))(_ctx, qPrintable(getPath(path)),stbuf) == 0)
		return(0);
	else
		return(-errno);
}
示例#3
0
int
smbc_stat(const char *url,
          struct stat *st)
{
        return smbc_getFunctionStat(statcont)(statcont, url, st);
}