Discuss this help topic in CBFS Forum

CallbackFileSystem.RouteToFile method

Filter:

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

CallbackFileSystem     See also    

Overview

Specifies the file, which should be used instead of firing further callbacks.

Declaration

[Pascal]
    procedure RouteToFile( FileInfo: TCbFsFileInfo; FileName : TCBString; Flags : integer );
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    void RouteToFile( CbFsFileInfo* FileInfo, const wchar_t * FileName, DWORD Flags );

[C++ (VCL)]
    void __fastcall RouteToFile( TCbFsFileInfo* FileInfo, TCBString FileName, DWORD Flags );

[C++ (.NET)]
    void RouteToFile( CbFsFileInfo^ FileInfo, String^ FileName, UInt32 Flags );

[C#]
    void RouteToFile( CbFsFileInfo FileInfo, String FileName, UInt32 Flags )

[VB.NET]
    Sub RouteToFile( ByVal FileInfo As CbFsFileInfo, ByVal FileName As String, ByVal Flags as UInt32 )

[Java]
    void routeToFile( CbFsFileInfo FileInfo, String FileName, UInt32 Flags )

Parameters

  • FileInfo - a structure which contains information about the file and a user-defined context common to all concurrent file create/open operations
  • FileName - The full path with the name to the file, which should be opened by CBFS driver instead of firing further callbacks.
  • Flags - Operation flags (see below)

Values of Flags

Description

Call this function from OnCreateFile or OnOpenFile callback / event handler to tell CBFS, that instead of calling further callbacks the driver must open and use the file specified in FileName parameter.

The MetaDataCache will keep information about the operation being routed, so further file open operations on this file will also go to the file specified by FileName, and not cause callbacks. To change this behavior you need to either disable the metadata cache, or use NotifyDirectoryChange() method with fanMetaDataModified flag and pass it the original filename, passed in parameters to OnCreateFile/OnOpenFile callback/event handler.

The flags let you still get callbacks / events on the file being routed. If you throw error from the callback / event handler, the corresponding operation will fail with the specified error code. If you use any of the *_CALLBACK flags, then CBFS_ROUTE_FILE_OPEN_CALLBACK and CBFS_ROUTE_FILE_CLOSE_CALLBACK are implied and the corresponding OnOpenFile and OnCloseFile callbacks / events will be called.

Call from...

This method may be called only from OnCreateFile or OnOpenFile callback / event handlers.

See also

EnableRouteCache method     NotifyDirectoryChange method     OnCreateFile event     OnOpenFile event    

Discuss this help topic in CBFS Forum