Discuss this help topic in CBFS Forum

OnIsDirectoryEmpty event/delegate/callback


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

CallbackFileSystem     See also    


The event is fired when the OS needs to check if the directory is empty.


    property OnIsDirectoryEmpty : TCbFsIsDirectoryEmptyEvent;
    TCbFsIsDirectoryEmptyEvent = procedure( Sender : TObject; DirectoryInfo: TCbFsFileInfo; FileName: TCBString; var IsEmpty: boolean ) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    void (__stdcall *CbFsIsDirectoryEmptyEvent)(void* Sender, CbFsFileInfo* DirectoryInfo, LPCWSTR FileName, LPBOOL IsEmpty );

[C++ (VCL)]
    typedef void (__closure *TCbFsIsDirectoryEmptyEvent)( System::TObject* Sender, TCbFsFileInfo* DirectoryInfo, TCBString FileName, bool & IsEmpty );

[C++ (.NET)]
    public __delegate void CbFsIsDirectoryEmptyEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ DirectoryInfo, String^ FileName, bool% IsEmpty );

    public void CbFsIsDirectoryEmptyEvent( CallbackFileSystem Sender, CbFsFileInfo DirectoryInfo, String FileName, ref bool IsEmpty );

    Sub CbFsIsDirectoryEmptyEvent( ByVal Sender As CallbackFileSystem, ByVal DirectoryInfo As CbFsFileInfo, ByVal FileName As String, ByRef IsEmpty As Boolean )

    void ICbFsEnumerateEvents.onIsDirectoryEmpty( CallbackFileSystem sender, CbFsFileInfo directoryInfo, string fileName, boolRef isEmpty );


  • Sender - reference to the class that called the delegate/event handler.
  • DirectoryInfo - information about the directory which is being queried.
  • FileName - the name of the directory whose status is queried
  • IsEmpty - the event handler must place the file attributes to this parameter


This event is fired when the OS wants to check whether the directory is empty or contains some files.

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. Throwing ECBFSError exception from this event handler will not cause the OS to abort the operation or display an error message to the user.

See also


Discuss this help topic in CBFS Forum