SK_PermissionsGrantControlToWorld Function

If possible, this function will give everyone access to read and write to the specified path.


On most operating systems (including Windows, OS X, and Linux), the execute permission flag/bit determines whether or not traversal is allowed when applied to a directory.

Using the SK_FLAGS_PERMISSIONS_FOLDERINHERIT flag and/or a Windows Registry path type is only supported in Windows. Therefore, using these in any other operating system will cause the function to fail and return SK_ResultCode.SK_ERROR_UNSUPPORTED_OS.

On non-Windows, POSIX compatible operating systems (like OS X and Linux), the permissions are set without any regard to any prior permissions. So for example, if everyone is allowed to execute a file before calling this function, calling this function against that file without the SK_FLAGS_PERMISSIONS_ALLOWEXECUTE flag will result in nobody having access to execute that file. Additionally, permissions are never inherited or set recursively when applied to a directory.


SK_ResultCode SK_PermissionsGrantControlToWorld(int flags, SK_PathType type, const char *path);
Visual Basic
Declare Function SK_PermissionsGrantControlToWorld(ByVal flags As Long, ByVal type As Long, ByVal path As String) As Long


Any flags passed into this function-call.
The type of path (see SK_PathType).
The absolute path to the file or Windows Registry key location.


All possible return values are included in the SK_ResultCode enumeration. Return codes to expect include:

Result Code Description
SK_ResultCode.SK_ERROR_NONE No error.
SK_ResultCode.SK_ERROR_INVALID_ARGUMENTS Some or all of the arguments are invalid.
SK_ResultCode.SK_ERROR_COULD_NOT_OPEN_REGISTRY_KEY An attempt to open a registry key failed.
SK_ResultCode.SK_ERROR_COULD_NOT_SET_PERMISSIONS An attempt to set a file or registry key's permissions failed.
SK_ResultCode.SK_ERROR_UNSUPPORTED_OS The current operating system is not supported by this feature or function.