Checking security rights to access a file or folder

The function checks for different levels of file/folder access rights for the current user.

Options

path - path to file or folder

level - checked level of access rights:

  • FILE_GENERIC_READ - read
  • FILE_GENERIC_WRITE - write
  • FILE_GENERIC_EXECUTE - executing
  • FILE_ALL_ACCESS - full rights
Result

If the result is equal to the constant corresponding to the query (FILE_GENERIC_READ, etc.), the rights are present.
0 - no rights or file/folder does not exist.

Author: admin