CBFS Connect 2020 Python Edition

Questions / Feedback?

on_get_file_name_by_file_id Event

Fires when the class needs to translate a file Id to a file or directory path.


class CBFSGetFileNameByFileIdEventParams(object):
  def file_id() -> int: ...
  def file_path() -> str: ...
  def file_path(value) -> None: ...
  def result_code() -> int: ...
  def result_code(value) -> None: ...

# In class CBFS:
def on_get_file_name_by_file_id() -> Callable[[CBFSGetFileNameByFileIdEventParams], None]: ...
def on_get_file_name_by_file_id(event_hook: Callable[[CBFSGetFileNameByFileIdEventParams], None]) -> None: ...


This event fires anytime the class needs a specified FileId translated to a file or directory path. This typically occurs when a process tries to open a file or directory by Id rather than by name (e.g., if FILE_OPEN_BY_FILE_ID is used when calling the Windows API's ZwCreateFile function); the on_open_file event fires after the path is obtained from this event.

This event must be handled if one of the use_disk_quotas or use_hard_links properties is enabled; otherwise it is optional, and applications need not implement it if the virtual filesystem doesn't support file Ids. To handle this event properly, applications must set FilePath to the absolute path of the file or directory associated with the specified FileId. The length of the path must not exceed the value of the max_file_path_length property.

The root directory (\) always uses the predefined Id 0x7FFFFFFFFFFFFFFF.

Please refer to the File IDs topic for more information.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

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