关于网友提出的“ chmod的问题”问题疑问,本网通过在网上对“ chmod的问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: chmod的问题
描述: 我想把文件属性改成系统该用什么函数呢?
chmod该文件系统就三个选项
Remarks
The _chmod function changes the permission setting of the file specified by filename. The permission setting controls read and write access to the file. The integer expression pmode contains one or both of the following manifest constants, defined in SYS\STAT.H:
_S_IWRITE
Writing permitted
_S_IREAD
Reading permitted
_S_IREAD | _S_IWRITE
Reading and writing permitted
解决方案1: Windows 下不要使用这种从 Linux 移植的函数来修改文件属性,函数成功返回也不一定会起作用,强烈推荐使用系统提供的方法。
解决方案2: windows的话使用系统提供的API吧
BOOL WINAPI SetFileAttributes(
__in LPCTSTR lpFileName,
__in DWORD dwFileAttributes
);
以上介绍了“ chmod的问题”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2277757.html