当前位置: 首页>>代码示例>>C++>>正文


C++ do_stat函数代码示例

本文整理汇总了C++中do_stat函数的典型用法代码示例。如果您正苦于以下问题:C++ do_stat函数的具体用法?C++ do_stat怎么用?C++ do_stat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了do_stat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ty_stat

int ty_stat(const char *path, ty_file_info *info, bool follow)
{
    assert(path && path[0]);
    assert(info);

    return do_stat(AT_FDCWD, path, info, follow);
}
开发者ID:seem-sky,项目名称:ty,代码行数:7,代码来源:system_posix.c

示例2: sys_stat

static int sys_stat(stat_args_t *arg)
{
        stat_args_t kern_args;
        struct stat buf;
        char *path;
        int ret;

        if (copy_from_user(&kern_args, arg, sizeof(kern_args)) < 0) {
                curthr->kt_errno = EFAULT;
                return -1;
        }

        if ((path = user_strdup(&kern_args.path)) == NULL) {
                curthr->kt_errno = EINVAL;
                return -1;
        }

        ret = do_stat(path, &buf);

        if (ret == 0) {
                ret = copy_to_user(kern_args.buf, &buf, sizeof(struct stat));
        }

        if (ret != 0) {
                kfree(path);
                curthr->kt_errno = -ret;
                return -1;
        }

        kfree(path);
        return 0;
}
开发者ID:Vidur-Malik,项目名称:cs167,代码行数:32,代码来源:syscall.c

示例3: link_stat

int link_stat(const char *path, STRUCT_STAT *buffer, int follow_dirlinks)
{
#ifdef SUPPORT_LINKS
	if (copy_links)
		return do_stat(path, buffer);
	if (do_lstat(path, buffer) < 0)
		return -1;
	if (follow_dirlinks && S_ISLNK(buffer->st_mode)) {
		STRUCT_STAT st;
		if (do_stat(path, &st) == 0 && S_ISDIR(st.st_mode))
			*buffer = st;
	}
	return 0;
#else
	return do_stat(path, buffer);
#endif
}
开发者ID:OPSF,项目名称:uClinux,代码行数:17,代码来源:flist.c

示例4: uffs_fstat

int uffs_fstat(int fd, struct uffs_stat *buf)
{
    uffs_Object *obj = FD2OBJ(fd);

    CHK_OBJ(obj, -1);

    return do_stat(obj, buf);
}
开发者ID:malooei,项目名称:yeejoin-workspace,代码行数:8,代码来源:uffs_fd.c

示例5: size

//: File size in bytes. Only if is_file() == true
off_t  FileInfo::size() const
{
  struct stat s;
  if (do_stat(filename_.c_str(), &s))
    return s.st_size;
  else
    return 0;
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:9,代码来源:FileInfo.C

示例6: created

//: Time of last status change. (creation, chmod, ...)
time_t FileInfo::created() const
{
  struct stat s;
  if (do_stat(filename_.c_str(), &s))
    return s.st_ctime;
  else
    return 0;
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:9,代码来源:FileInfo.C

示例7: accessed

//: Time of last access
time_t FileInfo::accessed() const
{
  struct stat s;
  if (do_stat(filename_.c_str(), &s))
    return s.st_atime;
  else
    return 0;
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:9,代码来源:FileInfo.C

示例8: modified

//: Time of last data modification. See 'man stat(2)'
time_t FileInfo::modified() const
{
  struct stat s;
  if (do_stat(filename_.c_str(), &s))
    return s.st_mtime;
  else
    return 0;
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:9,代码来源:FileInfo.C

示例9: is_dir

//: Returns TRUE if we are pointing to a directory or a symbolic link to
//: a directory.
bool FileInfo::is_dir()      const
{
  struct stat s;
  if (do_stat(filename_.c_str(), &s))
    return S_ISDIR(s.st_mode);
  else
    return false;
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:10,代码来源:FileInfo.C

示例10: is_file

  //: Returns TRUE if we are pointing to a file or a symbolic link to
  //: a file.
  bool FileInfo::is_file() const
  {
    struct stat s;
    if (do_stat(filename_, &s)) {
      return S_ISREG(s.st_mode);
    }

    return false;
  }
开发者ID:agrippa,项目名称:Trilinos,代码行数:11,代码来源:Ioss_FileInfo.C

示例11: size

  //: File size in bytes. Only if is_file() == true
  off_t FileInfo::size() const
  {
    struct stat s;
    if (do_stat(filename_, &s)) {
      return s.st_size;
    }

    return 0;
  }
开发者ID:agrippa,项目名称:Trilinos,代码行数:10,代码来源:Ioss_FileInfo.C

示例12: created

  //: Time of last status change. (creation, chmod, ...)
  time_t FileInfo::created() const
  {
    struct stat s;
    if (do_stat(filename_, &s)) {
      return s.st_ctime;
    }

    return 0;
  }
开发者ID:agrippa,项目名称:Trilinos,代码行数:10,代码来源:Ioss_FileInfo.C

示例13: modified

  //: Time of last data modification. See 'man stat(2)'
  time_t FileInfo::modified() const
  {
    struct stat s;
    if (do_stat(filename_, &s)) {
      return s.st_mtime;
    }

    return 0;
  }
开发者ID:agrippa,项目名称:Trilinos,代码行数:10,代码来源:Ioss_FileInfo.C

示例14: unix_lstat_64

CAMLprim value unix_lstat_64(value path)
{
  struct _stat64 buf;
  __int64 st_ino;
  if (!do_stat(1, 1, String_val(path), caml_string_length(path), NULL, &st_ino, &buf)) {
    uerror("lstat", path);
  }
  return stat_aux(1, st_ino, &buf);
}
开发者ID:ocsigen,项目名称:ocaml-eliom,代码行数:9,代码来源:stat.c

示例15: main

int main(int argc, char *argv[])
{
	int i;

	for (i = 1; i < argc; i++)
		do_stat(argv[i]);

	return 0;
}
开发者ID:virtuoso,项目名称:koowaldah,代码行数:9,代码来源:stat.c


注:本文中的do_stat函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。