Discuss this help topic in CBFS Forum

CallbackFileSystem.NotifyDirectoryChange method

Filter:

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

CallbackFileSystem    

Overview

Notifies the OS that the the file or directory has been changed.

Declaration

[Pascal]
    function NotifyDirectoryChange(FileName: TCBString; Action: TCbFsNotifyFileAction; Wait: boolean ) : boolean;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    bool NotifyDirectoryChange(PCWSTR FileName, CbFsNotifyFileAction Action, bool Wait);

[C++ (VCL)]
    bool __fastcall NotifyDirectoryChange( TCBString FileName, TCbFsNotifyFileAction Action, bool Wait);

[C++ (.NET)]
    bool NotifyDirectoryChange(String^ FileName, CbFsNotifyFileAction Action, bool Wait);

[C#]
    bool NotifyDirectoryChange(String FileName, CbFsNotifyFileAction Action, bool Wait);

[VB.NET]
    Function NotifyDirectoryChange(ByVal FileName As String, ByVal Action as CbFsNotifyFileAction, ByVal Wait as Boolean) As Boolean

[Java]
    bool notifyDirectoryChange( String fileName, int action, boolean wait);

Parameters

  • FileName - specifies the path name of the file or directory which was changed, added or deleted, without the mounting point name (eg. "\path\to\filename.ext" is a correct form)
  • Action - specifies the type of the change
  • Wait - specifies if the operation must be completed before the function returns (see Description section for details)

Return values

TRUE / true if the function succeeded or FALSE / false if the function failed.

Values of CbFsNotifyFileAction

Description

Use this method to notify the operating system that some changes took place for the file or directory by means external to the virtual file system. For example, if you map the database to the file system and something has directly changed database contents, you should notify the OS about the external change using this method. You should NOT notify the file system about the change which your application or any external application makes by utilizing file manipulation APIs and passing file or directory on the virtual fiile system to these APIs.

If you set Wait parameter to true and the call is made not from the callback / event handler, the function will return only after all actions, caused by the call, are complete. If you set Wait parameter to false or if the call is made from the callback / event handler, the function sends update request to the OS and returns immediately, and the request is processed in background.

There's no way to notify the OS about the change synchronously from the callback / event handler.

Call from...

This method may be called from callback / event handlers or from outside of callback / event handlers.

Discuss this help topic in CBFS Forum