我的程序要用到文件夹来做缓冲区,有时候用户设置了没有写入权限的文件夹
作为缓冲区,如何在设置的时候就不用通过写入文件来判断阿?NTFS格式

解决方案 »

  1.   

    DWORD GetFileAttributes(
      LPCTSTR lpFileName   // name of file or directory
    );
    如果返回里面有FILE_ATTRIBUTE_READONLY就是只读
      

  2.   

    如果不通过读写文件的话,应该使用安全属性。
    具体的可以参考<Windows2000编程技术内幕?CH-7
      

  3.   

    DWORD GetFileAttributes(
      LPCTSTR lpFileName   // name of file or directory
    );DWORD SetFileAttributes(
      LPCTSTR lpFileName   // name of file or directory
    );
      

  4.   

    GetFileAttributes 只能看到 只读 这类的信息,
    我要知道的是NTFS格式的磁盘中目录的权限,
    比如winnt目录,通常USERS这个组的用户就没有写的权限
      

  5.   

    DentistryDoctor(雅克医生<改行做程序员了>) 
    是正解.
    GetFileSecurity获取文件安全属性
    SetFileSecurity修改文件安全属性