日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

关于readdir返回值中struct dirent.d_type的取值有关问题(转)

發布時間:2025/5/22 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 关于readdir返回值中struct dirent.d_type的取值有关问题(转) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

關于readdir返回值中struct dirent.d_type的取值問題

原網頁鏈接

http://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html

原文及翻譯

混在一起寫了


unsigned char d_type

??? This is the type of the file, possibly unknown. The following constants are defined for its value:

??? DT_UNKNOWN
??????? The type is unknown. Only some filesystems have full support to return the type of the file, others might always return this value.

???????? 類型未知。少數文件系統會出現此函數不支持的文件類型,另一些則總是返回這個值。譯者注:總之這個值是為了應對不兼容的文件系統而設置的。


??? DT_REG
??????? A regular file.

??????? 常規文件


??? DT_DIR
??????? A directory.

??????? 目錄


??? DT_FIFO
??????? A named pipe, or FIFO. See FIFO Special Files.

??????? 一個命名管道,或FIFO。


??? DT_SOCK
??????? A local-domain socket.

??????? 套接字


??? DT_CHR
??????? A character device.

???????? 字符設備


??? DT_BLK
??????? A block device.

???????? 塊設備


??? DT_LNK
??????? A symbolic link.?

???????? 符號鏈接

d_type的具體數值

以下內容轉自http://blog.csdn.net/angle_birds/article/details/8503039

?

d_type表示檔案類型:enum { DT_UNKNOWN = 0, # define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, # define DT_FIFO DT_FIFO DT_CHR = 2, # define DT_CHR DT_CHR DT_DIR = 4, # define DT_DIR DT_DIR DT_BLK = 6, # define DT_BLK DT_BLK DT_REG = 8, # define DT_REG DT_REG DT_LNK = 10, # define DT_LNK DT_LNK DT_SOCK = 12, # define DT_SOCK DT_SOCK DT_WHT = 14 # define DT_WHT DT_WHT };

?

轉載于:https://www.cnblogs.com/jikexianfeng/p/6225846.html

總結

以上是生活随笔為你收集整理的关于readdir返回值中struct dirent.d_type的取值有关问题(转)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。