首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

如何获取文件类型

2012-03-25 
怎么获取文件类型用C语言怎么获取文件类型?[解决办法]看你是做windows应用还是unix了window有访问控制列表

怎么获取文件类型
用C语言怎么获取文件类型?

[解决办法]
看你是做windows应用还是unix了
window有访问控制列表的低级访问控制函数low level access control functions
linux就是相关的access, chmod之类的。
相对来说window的文件属性操作要复杂的多

[解决办法]
GetFileType

The GetFileType function returns the type of the specified file.

DWORD GetFileType(
HANDLE hFile // file handle
);

Parameters
hFile
Handle to an open file handle.
Return Values
The return value is one of the following values:

Value Meaning
FILE_TYPE_UNKNOWN The type of the specified file is unknown.
FILE_TYPE_DISK The specified file is a disk file.
FILE_TYPE_CHAR The specified file is a character file, typically an LPT device or a console.
FILE_TYPE_PIPE The specified file is either a named or anonymous pipe.

热点排行
Bad Request.