#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
創(chuàng)新互聯(lián)建站2013年開創(chuàng)至今,先為府谷等服務(wù)建站,府谷等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為府谷企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。
int main(void)
{
DIR dir = NULL;
struct dirent ptr = (struct dirent )calloc(1, sizeof(struct dirent));
struct dirent result = NULL;
dir = opendir("/root/tmp");
if (!dir) {
printf ("opendir failed\n");
return 1;
}
while ((readdir_r(dir, ptr, &result)==0) && (result != NULL)) {
printf ("name:%s\n", result->d_name);
}
closedir(dir);
return 0;
}
分享標(biāo)題:C語(yǔ)言目錄操作
網(wǎng)頁(yè)URL:http://chinadenli.net/article32/pddpsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、App設(shè)計(jì)、ChatGPT、網(wǎng)站設(shè)計(jì)公司、全網(wǎng)營(yíng)銷推廣、網(wǎng)頁(yè)設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)