日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

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

發布時間:2025/5/22 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 关于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的取值有关问题(转)的全部內容,希望文章能夠幫你解決所遇到的問題。

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