2.12.2. hook_file_access

[<<<] [>>>]

@c file_access

This function gets a file name as an argument and return an integer code that tells the caller if the program is allowed to read, write or both read and write to the file. The default implementation just dumbly answers that the program is allowed both read and write. This function is called by each other hook functions that access a file via the file name. If a module wants to restrict the basic code to access files based on the file name the module does not need to alter all hook functions that access files via file name.

The module has to write its own file_access hook function instead, alter the hook function table to point to the module's function and all file accessing functions will ask the module's hook function if the code may access the file.

The argument pszFileName is the name of the file that the ScriptBasic program want to do something. The actual file_access hook function should decide if the basic program is

The default implementation of this function just allows the program to do anything. Any extension module may have its own implementation and restrict the basic program to certain files.

int hook_file_access(pExecuteObject pEo,
                     char *pszFileName

[<<<] [>>>]