Discuss this help topic in CBFS Forum

OnSetFileAttributes event/delegate/callback

Filter:

Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

CallbackFileSystem     See also    

Overview

This event is fired when the OS or the application needs to change the attributes or times of the open file.

Declaration

[Pascal]
    property OnSetFileAttributes : TCbFsSetFileAttributesEvent;
    TCbFsSetFileAttributesEvent = procedure( Sender : TObject; FileInfo: TCbFsFileInfo; HandleInfo: TCbFsHandleInfo; CreationTime: TDateTime; LastAccessTime: TDateTime; LastWriteTime: TDateTime; ChangeTime: TDateTime; FileAttributes: LongWord ) of object;

[C++ (Lib)]
    void (__stdcall *CbFsSetFileAttributesEvent)(void* Sender, CbFsFileInfo* FileInfo, CbFsHandleInfo* HandleInfo, const FILETIME * CreationTime, const FILETIME * LastAccessTime, const FILETIME * LastWriteTime, const FILETIME * ChangeTime, unsigned long & FileAttributes );

[C++ (VCL)]
    typedef void (__closure *TCbFsSetFileAttributesEvent)( System::TObject* Sender, TCbFsFileInfo* FileInfo, TCbFsHandleInfo* HandleInfo, TDateTime CreationTime, TDateTime LastAccessTime, TDateTime LastWriteTime, TDateTime ChangeTime, unsigned long FileAttributes );

[C++ (.NET)]
    public __delegate void CbFsSetFileAttributesEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ FileInfo, CbFsHandleInfo^ HandleInfo, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, DateTime ChangeTime, UInt32 FileAttributes );

[C#]
    public void CbFsSetFileAttributesEvent( CallbackFileSystem Sender, CbFsFileInfo FileInfo, CbFsHandleInfo HandleInfo, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, DateTime ChangeTime, UInt32 FileAttributes );

[VB.NET]
    Sub CbFsSetFileAttributesEvent( ByVal Sender As CallbackFileSystem, ByVal FileInfo As CbFsFileInfo, ByVal HandleInfo As CbFsHandleInfo, ByVal CreationTime As DateTime, ByVal LastAccessTime As DateTime, ByVal LastWriteTime As DateTime, ByVal ChangeTime As DateTime, ByVal FileAttributes As UInt32 )

[Java]
    void ICbFsFileEvents.onSetFileAttributes( CallbackFileSystem sender, CbFsFileInfo fileInfo, CbFsHandleInfo fileHandleContext, Date creationTime, Date lastAccessTime, Date lastWriteTime, Date changeTime, long fileAttributes );

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileInfo - contains information about the file
  • HandleInfo - contains information about particular opened file or directory handle
  • CreationTime - the time of the object creation. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • LastAccessTime - the time of the last access to the object. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • LastWriteTime - the time of the last modification to the object. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • ChangeTime - the time of the last change of object contents or metadata (eg. security attributes).
    Set ChangeTimeAttributeSupported property to true if you plan to use this parameter.
  • FileAttributes - the attributes of the file. Attributes can be 0 if attributes must be left intact (not changed). FILE_ATTRIBUTE_NORMAL is used to reset attributes.

Description

This event is fired when the OS or the application needs to change the times and/or the attributes of the open file.
Read more about contexts.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to Callback File System.

See also

ChangeTimeAttributeSupported property     OnCloseFile event     OnCreateFile event     OnOpenFile event    

Discuss this help topic in CBFS Forum