Monday, 30 April 2012

how to check in C++ for access and not use VirtualStore redirection in Win7 _access

Here's how to check and not do virtualization redirection:-

#include <io.h>


if( (_access( "c:\\yourfile.txt", 2 )) != -1)
{
     AfxMessageBox( "has write permission\n" );
}
else
{
    AfxMessageBox( "doesn't have write permission\n" );

   // here you can change the path to something else.

}

No comments:

Post a Comment