GetFileNameByFileId Event

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


class CBFSGetFileNameByFileIdEventParams {
  qint64 FileId();
  const QString &FilePath();
  bool SetFilePath(const QString &lpFilePath);
  int ResultCode();
  void SetResultCode(int iResultCode);
  int EventRetVal();
  void SetEventRetVal(int iRetVal);
// To handle, connect one or more slots to this signal. void GetFileNameByFileId(CBFSGetFileNameByFileIdEventParams *e);
// Or, subclass CBFS and override this emitter function. virtual int FireGetFileNameByFileId(CBFSGetFileNameByFileIdEventParams *e) {...}


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 OpenFile event fires after the path is obtained from this event.

This event must be handled if one of the UseDiskQuotas or UseHardLinks properties is enabled; otherwise it is optional, and applications need not implement it if the virtual filesystem doesn't support file Ids.
Note: NFS sharing makes use of 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 MaxFilePathLength property. The parameter's setter function will return false if the specified value is too long.

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) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Qt Edition - Version 20.0 [Build 8348]