CBFS FUSE 2020 C++ Builder Edition

Questions / Feedback?

GetAttr Event

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

Syntax

typedef struct {
  String Path;
  int FileContext;
  __int64 Ino;
  int Mode;
  int Uid;
  int Gid;
  int LinkCount;
  __int64 Size;
  TDateTime ATime;
  TDateTime MTime;
  TDateTime CTime;
  int Result;
} TcbuFUSEGetAttrEventParams;

typedef void __fastcall (__closure *TcbuFUSEGetAttrEvent)(System::TObject* Sender, TcbuFUSEGetAttrEventParams *e);

__property TcbuFUSEGetAttrEvent OnGetAttr = { read=FOnGetAttr, write=FOnGetAttr };

Remarks

This event fires when the OS needs information about the file or directory identified by either Path or FileContext (the latter in most cases will not be initialized). If the entry with the specified name does not exist, the handler must return ENOENT in Result parameter.

The Ino parameter should be set to the ID of the file, which must be unique within a filesystem. Ino is optional on Windows and is ignored on Linux, where FUSE internally generates internal IDs.

The Mode parameter is a combination of bit flags.
Windows: Mode may include 0x4000 (S_IFDIR) to indicate that the entry is a directory, and must include either 0x80 (S_IWUSR) to indicate a file that can be read and written or 0x100 (S_IRUSR) to indicate a read-only file. Other flags are ignored.
Linux: Mode may include any appropriate file mode flags. See inode(7) for more information.

Windows: The Uid, Gid, and LinkCount parameters are not used.
Linux: The Uid and Gid parameters must be set to the owner's user ID and group ID respectively. LinkCount should be set to the number of hard links that the file has (which usually is 1).

Size must be set to the size of the file's data. For directories, the parameter should be set to 0.

ATime, MTime, CTime: Set respectively to the Access Time, Modification Time, and Creation Time values of the file or directory. All date/time parameters in the component are specified in UTC.

To convert Unix time to the format, suitable for this event, use the UnixTimeToFileTime method.

Windows: Any non-applicable time values can be left unchanged, or set to January 1, 1601 00:00:00 UTC.

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 negative error code value (e.g. -ENOENT to indicate that the file does not exist) 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 FUSE 2020 C++ Builder Edition - Version 20.0 [Build 8348]