以及判断某一文件夹是否可以写入?
谢谢

解决方案 »

  1.   

    When used with files, the _access function determines whether the specified file exists and can be accessed as specified by the value of mode. When used with directories, _access determines only whether the specified directory exists; in Windows NT, all directories have read and write access./* ACCESS.C: This example uses _access to check the
     * file named "ACCESS.C" to see if it exists and if
     * writing is allowed.
     */#include  <io.h>
    #include  <stdio.h>
    #include  <stdlib.h>void main( void )
    {
       /* Check for existence */
       if( (_access( "ACCESS.C", 0 )) != -1 )
       {
          printf( "File ACCESS.C exists\n" );
          /* Check for write permission */
          if( (_access( "ACCESS.C", 2 )) != -1 )
             printf( "File ACCESS.C has write permission\n" );
       }
    }
      

  2.   

    CFileFind FileFind;
    FileFind.FindFile (pathname)
    CreateDirectory (pathname,NULL);//APIGetFileAttributes()