腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
用于rootkit的syscall实现
、
、
代码在这里:{); d = (struct
linux
_dirent *) ((char*)
dirp
*) ((char*)
dirp
+ bpos); d和
dirp
都保存
浏览 3
提问于2021-12-28
得票数 1
回答已采纳
2
回答
如何获取一个目录下的目录数?
、
、
、
int listFilesIndir(char *currDir) struct dirent *direntp; int x ,y =0 ;if ((
dirp
= opendir(currDir)) == NULL) perror ("Failed to open directory");return 1; {
浏览 2
提问于2013-04-02
得票数 0
回答已采纳
1
回答
LKM
linux
_dirent实现
、
、
、
根据getdents文档,您必须实现自己的
linux
_dirent结构()。这一切似乎都有效,但我无法正确地读取
linux
_dirent名称。
Linux
_dirent的实现: u64 d_ino;{ unsigned int bpos = 0;
浏览 2
提问于2018-09-01
得票数 0
回答已采纳
1
回答
System ()系统调用
、
我的代码:{ int bpos; int (*orig_func)(unsigned int fd,struct
linux
_dirent64 *
dirp
, unsigned int count);
浏览 2
提问于2014-02-13
得票数 3
回答已采纳
5
回答
从C++列出
Linux
中的目录
、
我正在尝试使用c中的
linux
api来模拟
linux
命令ls。查看代码确实有意义,但是当我运行它时,我得到了"stat error:没有这样的文件或目录“。我已经检查过opendir是否工作正常。include <dirent.h>#include <errno.h> { { fprintf( stderr, "Usage:
浏览 1
提问于2010-04-09
得票数 1
回答已采纳
4
回答
检查一下是否有。readdir返回的条目是一个目录、链接或文件。->d_ type没有显示类型。
、
、
、
、
我正在编写一个运行在
Linux
中的程序,并接受一个参数(一个目录),并显示目录中的所有文件以及它们的类型。 << .include <dirent.h>{ DIR *
dirp
";
dirp
= opendir(argv[1]); // specify directory here: &q
浏览 7
提问于2014-05-30
得票数 12
回答已采纳
2
回答
为什么这个列出目录的C代码不能工作?
、
#include <sys/syscall.h>#include <stdlib.h>typedef struct
linux
_dirent{ unsigned long d_off; char d_name[];extern int getdents(unsigned int f
浏览 3
提问于2014-03-11
得票数 0
回答已采纳
2
回答
Windows fnmatch替代
、
、
我在
Linux
中有以下代码,用于查找与给定通配符匹配的文件: { DIR*
dirp
= opendir(directory.c_str()); if (<
浏览 5
提问于2016-03-08
得票数 1
回答已采纳
4
回答
在C中,是否有一种方法可以获得多个文件的大小,这些文件的名称与字符串相匹配?
我有这样的文件: 我有很多这样的文件,所以不能单独指定每个名字。我知道如何读取单个文件的大小。我在修窗户。#include <sys/stat.h> // For struct stat and stat() struct stat attr;
浏览 2
提问于2015-02-19
得票数 0
回答已采纳
2
回答
当我尝试从目录读取时,为什么我的程序seg出错?
、
block of size 250 free'd==26237== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-
linux
.soblock of s
浏览 1
提问于2018-10-18
得票数 0
回答已采纳
1
回答
C打开和读取目录
、
、
、
因此,我试图用C语言编写一个程序,就像
Linux
中的ls命令一样,目前我已经能够列出当前工作目录中的文件和目录,但是我似乎无法对不是我的CWD的目录做同样的工作,我需要在开始列出它之前更改它吗?它必须像
Linux
中的ls -li那样工作,但是我处理了打印工作。一般来说,我的程序看起来是这样的(很明显,它有更多的东西):struct dirent *
dirp
;struct stat filestat; if ( (d = opendir(d
浏览 2
提问于2015-10-07
得票数 0
回答已采纳
1
回答
如何按修改日期列出目录中的文件?
、
、
、
{ } sizeof(
dirp
->curentry.d_name) );
浏览 27
提问于2015-08-26
得票数 0
1
回答
readdir API试图读取大于2GB的文件
、
我对
Linux
编程很陌生。我试图实现一个错误场景,其中32位readdir() API试图读取大于2GB的文件。 FILE *fp;struct dirent *
dirp
;for(i=1;i<=15;i++) errno
浏览 1
提问于2015-10-14
得票数 1
3
回答
分段故障检测
、
、
、
strcmp(dname, bname)) { return NULL; DIR *
dirp
= opendir(dname); while (((direntp = readdir(
dirp
)) != NULL) && (strcmp(direntp->d_name, bname))) { if ((direntp = readdir(
浏览 2
提问于2017-02-17
得票数 0
回答已采纳
3
回答
如何检查文件夹C中是否存在文件
sys/types.h>#include <dirent.h> { struct dirent *direntp; if (
dirp
== NULL) printfFile could not be open\n"); retu
浏览 0
提问于2014-02-19
得票数 0
1
回答
错误: stat: C编程中没有此类文件或目录、opendir()和stat()
、
、
、
当我在shell中执行我的程序(我正在使用redhat
linux
)时,我收到了错误“”。include <time.h>#include <stdlib.h> dent = readdir(
dirp
); { ///
浏览 4
提问于2014-05-31
得票数 1
回答已采纳
6
回答
用C打印出文件名及其大小
、
、
、
、
我不确定C是否能做到这一点,但我希望我能制作一个程序,查看一个目录,并打印出目录的所有内容以及每个文件的文件大小。我希望它看起来像这样(可能): 文件2.txt- 400字节 到目前为止,我创建了一个可以打开文件的程序,它将打印字节,但是它不能读取整个目录,而且我必须具体说明我想要读取的文件。(这不是我想要的)。#include <stdio.h> FILE *fp; // file pointer long
浏览 5
提问于2013-01-28
得票数 2
1
回答
字符串未声明(在此函数中首次使用),当我明确定义它时。有什么问题吗?
、
、
void find_file(char* dir_name, char* file_to_find) { struct dirent*
dirp
; if (
dirp
->d_type == DT_DIR) {
浏览 4
提问于2022-04-06
得票数 0
2
回答
使用c++查找文件大小
、
、
、
、
更多的问题,我真的很困惑,这让我困扰不已,我也尝试了几乎所有使用dirent.h的方法。但这里有一个我想要的例子:#include "DataEventResponseMsg.idl" cout << "This is the size: " << sizeof(DataEventResponseMsg) << endl;} 它所做的就是包含这个特定的文件,并找到它的大
浏览 0
提问于2013-01-31
得票数 1
回答已采纳
3
回答
使用dirent提取文件名
int getDir (string dir, vector<string> &files) DIR *dp; return errno; co
浏览 1
提问于2011-05-19
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Linux文件操作:利用C语言删除某个目录下的文件
Linux DNS 查询剖析 Linux 中国
Manjaro Linux 22.0 发布|Linux 中国
Alpine Linux 3.18 发布|Linux 中国
Linux基础(3)linux命令3
热门
标签
更多标签
云服务器
ICP备案
云直播
对象存储
腾讯会议
活动推荐
运营活动
广告
关闭
领券