OnSetFileAttributes event/delegate/callback

Filter:

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

CBFSConnect     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 : TCBSetFileAttributesEvent;
    TCBSetFileAttributesEvent = procedure( Sender : TObject; FileInfo: TCBFileInfo; HandleInfo: TCBHandleInfo; CreationTime: TDateTime; LastAccessTime: TDateTime; LastWriteTime: TDateTime; ChangeTime: TDateTime; FileAttributes: LongWord ) of object;

[C++ (Lib)]
    void (__stdcall *CBSetFileAttributesEvent)(void* Sender, CBFileInfo* FileInfo, CBHandleInfo* HandleInfo, FILETIME * CreationTime, FILETIME * LastAccessTime, FILETIME * LastWriteTime, FILETIME * ChangeTime, unsigned long FileAttributes );

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

[C++ (.NET)]
    public __delegate void CBSetFileAttributesEvent( CBFSConnect^ Sender, CBFileInfo^ FileInfo, CBHandleInfo^ HandleInfo, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, DateTime ChangeTime, UInt32 FileAttributes );

[C#]
    public void CBSetFileAttributesEvent( CBFSConnect Sender, CBFileInfo FileInfo, CBHandleInfo HandleInfo, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, DateTime ChangeTime, UInt32 FileAttributes );

[VB.NET]
    Sub CBSetFileAttributesEvent( ByVal Sender As CBFSConnect, ByVal FileInfo As CBFileInfo, ByVal HandleInfo As CBHandleInfo, ByVal CreationTime As DateTime, ByVal LastAccessTime As DateTime, ByVal LastWriteTime As DateTime, ByVal ChangeTime As DateTime, ByVal FileAttributes As UInt32 )

[Java]
    void ICbFsFileEvents.onSetFileAttributes( CBFSConnect sender, CBFileInfo fileInfo, CBHandleInfo 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 CBFS Connect.

See also

ChangeTimeAttributeSupported property     OnCloseFile event     OnCreateFile event     OnOpenFile event