CBFS Connect 2020 Python Edition

Questions / Feedback?

route_to_file Method

Instructs the class to route future requests directly to a given file.

Syntax

def route_to_file(file_info: int, file_name: str, flags: int) -> bool: ...

Remarks

This method can be called from within the on_create_file or on_open_file event to instruct the class to route any future requests against the file specified by FileInfo directly to the file at the path specified by FileName instead of firing the corresponding events. The Flags parameter is used to specify which kinds of requests should not be routed automatically (see below).

Pass the value obtained from the on_create_file or on_open_file event's FileInfo parameter for this method's FileInfo parameter.

This method returns either True or False to indicate whether routing was set up successfully. If, after this method is called successfully, the application later wishes for routing to cease, it may do one of the following:

The Flags value should be created by OR'ing together zero or more of the following flags:

CBFS_ROUTE_FILE_READ_ONLY0x00000001Causes files to be treated as read-only; all write operations will be automatically denied.

CBFS_ROUTE_OPEN_EVENT0x00000020Prevents 'open' requests from being routed automatically.

If set, the on_open_file event will fire as usual when such requests arrive.

Note: This flag is implied if any of the other CBFS_ROUTE_*_EVENT flags are present.

CBFS_ROUTE_CLEANUP_EVENT0x00000040Prevents 'cleanup' requests from being routed automatically.

If set, the on_cleanup_file event will fire as usual when such requests arrive.

CBFS_ROUTE_CLOSE_EVENT0x00000080Prevents 'close' requests from being routed automatically.

If set, the on_close_file event will fire as usual when such requests arrive.

Note: This flag is implied if any of the other CBFS_ROUTE_*_EVENT flags are present.

CBFS_ROUTE_ENUMERATE_DIRECTORY_EVENT0x00000200Prevents 'enumerate directory' requests from being routed automatically.

If set, the on_enumerate_directory event will fire as usual when such requests arrive.

CBFS_ROUTE_SET_SECURITY_EVENT0x00000400Prevents 'set security' requests from being routed automatically.

If set, the on_set_file_security event will fire as usual when such requests arrive.

CBFS_ROUTE_GET_SECURITY_EVENT0x00000800Prevents 'get security' requests from being routed automatically.

If set, the on_get_file_security event will fire as usual when such requests arrive.

CBFS_ROUTE_SET_FILE_ATTRIBUTES_EVENT0x00002000Prevents 'set file attributes' requests from being routed automatically.

If set, the on_set_file_attributes event will fire as usual when such requests arrive.

CBFS_ROUTE_SET_FILE_SIZES_EVENT0x00004000Prevents 'set file size' requests from being routed automatically.

If set, the on_set_file_size event will fire as usual when such requests arrive.

CBFS_ROUTE_SET_VALID_DATA_LENGTH_EVENT0x00008000Prevents 'set valid data length' requests from being routed automatically.

If set, the on_open_file event will fire as usual when such requests arrive.

CBFS_ROUTE_CREATE_HARD_LINK_EVENT0x00020000Prevents 'create hard link' requests from being routed automatically.

If set, the on_create_hard_link event will fire as usual when such requests arrive.

CBFS_ROUTE_QUERY_QUOTA_EVENT0x00040000Prevents 'query quota' requests from being routed automatically.

If set, the on_query_quotas event will fire as usual when such requests arrive.

CBFS_ROUTE_SET_QUOTA_EVENT0x00080000Prevents 'set quota' requests from being routed automatically.

If set, the on_set_quotas event will fire as usual when such requests arrive.

CBFS_ROUTE_CAN_FILE_BE_DELETED_EVENT0x00200000Prevents 'can file be deleted' requests from being routed automatically.

If set, the on_can_file_be_deleted event will fire as usual when such requests arrive.

CBFS_ROUTE_IS_DIRECTORY_EMPTY_EVENT0x00400000Prevents 'is directory empty' requests from being routed automatically.

If set, the on_is_directory_empty event will fire as usual when such requests arrive.

CBFS_ROUTE_RENAME_EVENT0x00800000Prevents 'rename/move' requests from being routed automatically.

If set, the on_rename_or_move_file event will fire as usual when such requests arrive.

Note: This method can only be called within the on_create_file and on_open_file event handlers.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Python Edition - Version 20.0 [Build 8348]