您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> C/C++ >> chmod的问题

chmod的问题

来源:网络整理     时间:2016/7/4 17:28:55     关键词:

关于网友提出的“ 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

相关图片

相关文章