GetFileInfo Event

Fires when the OS needs information about a file or directory.


class CBFSGetFileInfoEventParams {
  const QString &FileName();
  bool FileExists();
  void SetFileExists(bool bFileExists);
  const QDateTime &CreationTime();
  void SetCreationTime(const QDateTime &qdtCreationTime);
  const QDateTime &LastAccessTime();
  void SetLastAccessTime(const QDateTime &qdtLastAccessTime);
  const QDateTime &LastWriteTime();
  void SetLastWriteTime(const QDateTime &qdtLastWriteTime);
  const QDateTime &ChangeTime();
  void SetChangeTime(const QDateTime &qdtChangeTime);
  qint64 Size();
  void SetSize(qint64 lSize);
  qint64 AllocationSize();
  void SetAllocationSize(qint64 lAllocationSize);
  qint64 FileId();
  void SetFileId(qint64 lFileId);
  qint64 Attributes();
  void SetAttributes(qint64 lAttributes);
  int HardLinkCount();
  void SetHardLinkCount(int iHardLinkCount);
  const QString &ShortFileName();
  bool SetShortFileName(const QString &lpShortFileName);
  const QString &RealFileName();
  bool SetRealFileName(const QString &lpRealFileName);
  int ResultCode();
  void SetResultCode(int iResultCode);
  int EventRetVal();
  void SetEventRetVal(int iRetVal);
// To handle, connect one or more slots to this signal. void GetFileInfo(CBFSGetFileInfoEventParams *e);
// Or, subclass CBFS and override this emitter function. virtual int FireGetFileInfo(CBFSGetFileInfoEventParams *e) {...}


This event fires when the OS needs information about the file or directory specified by FileName and in some other cases (see the notes below).

To handle this event properly, applications should first check whether the specified file or directory exists, and set FileExists accordingly. If no such file or directory exists, set FileExists to false. If the file or directory exists, set FileExists to true and supply its information using the following parameters:

  • CreationTime, LastAccessTime, LastWriteTime, ChangeTime: Set to the corresponding time values of the file or directory, specified in UTC. Any non-applicable time values can be left unchanged, or set to January 1, 1601 00:00:00 UTC.
  • Size: For files, set to the size of the file, in bytes; for directories, set to 0.
  • AllocationSize: For files, set to the number of bytes allocated locally for the file; for directories, set to 0. The allocation size is typically a multiple of the ClusterSize.
  • FileId: Set to the unique Id of the file or directory. Please refer to the File IDs topic for more information.
  • Attributes: Set to the attributes of the file or directory.
  • HardLinkCount: If the UseHardLinks property is enabled, set to the number of hard links that point to the file. The default value is 1 (which is also the only valid value for directories). Please refer to the Hard Links topic for more information.
  • ShortFileName: If the UseShortFileNames property is enabled, set to the short (8.3) name of the file.
    • If UseShortFileNames is enabled, it's possible that FileName is already a short name. In such cases, return the same name in ShortFileName.
    • The short name must adhere to the 8.3 name format; please refer to the Short File Names topic for more information.
    • The parameter's setter function will return false if the specified value is too long.
  • RealFileName: If the UseCaseSensitiveFileNames property is enabled, and FileName's casing differs from that of the actual file or directory name, set to the "real" name of said file or directory.
    • For example, if the requested FileName is QWERTY.txt, but the only similarly-named file in the virtual filesystem is qwErTy.TxT, then this parameter should be set to the latter.
    • If the specified FileName includes a path, it must be preserved in the value returned via RealFileName; only the casing of the filename and extension may be corrected.
    • The length of the returned name (and path, if applicable) must not exceed the value of the MaxFilePathLength property.
    • The parameter's setter function will return false if the specified value is too long.


  1. if the UseCaseSensitiveFileNames and UseAlternateDataStreams properties are both enabled, this event may also be used to obtain the "real name" of a named stream. When returning the name of a named stream via the RealFileName parameter, prepend a colon (:) to the stream's name so that it looks like, e.g, :Zone.Identifier.
  2. if the UpdateFileMetadataOnOpen config setting is true, this event will fire right after the OpenFile event but only if the file was fully closed before OpenFile.

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]