#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ù)解決您的所有建站問題。
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語言目錄操作
網(wǎng)頁URL:http://jinyejixie.com/article32/pddpsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計、App設(shè)計、ChatGPT、網(wǎng)站設(shè)計公司、全網(wǎng)營銷推廣、網(wǎng)頁設(shè)計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)