[This is preliminary documentation and is subject to change.]

When overriden in derived class retrieves the first file in a directory of the plugin's file system.

Namespace:  Tools.TotalCommanderT
Assembly:  Tools.TotalCommander (in Tools.TotalCommander.dll) Version: 1.5.2.0

Syntax

C#
public abstract Object FindFirst(
	string Path,
	ref FindData FindData
)
Visual Basic (Declaration)
Public MustOverride Function FindFirst ( _
	Path As String, _
	ByRef FindData As FindData _
) As Object
Visual C++
public:
virtual Object^ FindFirst(
	String^ Path, 
	FindData% FindData
) abstract
J#
public abstract Object FindFirst(
	String Path,
	/** @ref */FindData FindData
)
JScript
public abstract function FindFirst(
	Path : String, 
	FindData : FindData
) : Object

Parameters

Path
Type: System..::.String
Full path to the directory for which the directory listing has to be retrieved. Important: no wildcards are passed to the plugin! All separators will be backslashes, so you will need to convert them to forward slashes if your file system uses them!

As root, a single backslash is passed to the plugin. The root items appear in the plugin base directory retrieved by Name at installation time. This default root name is NOT part of the path passed to the plugin!

All subdirs are built from the directory names the plugin returns through FindFirst(String, FindData%) and FindNext(Object, FindData%), separated by single backslashes, e.g. \Some server\c:\subdir

FindData
Type: Tools.TotalCommanderT..::.FindData %
A FindData struct (mimics WIN32_FIND_DATA as defined in the Windows SDK) to be pupulated with the file or directory details. Use the Attributes field set to Directory to distinguish files from directories. On Unix systems, you can | (or) the Attributes field with 0x80000000 and set the ReparsePointTag parameter to the Unix file mode (permissions).

Return Value

Any object. It is recommended to return object that represents current state of the search. This will allow recursive directory searches needed for copying whole trees. This object will be passed to FindNext(Object, FindData%) by the calling program. Returned object is added to HandleDictionary

Null if there are no more files.

Remarks

FindFirst(String, FindData%) may be called directly with a subdirectory of the plugin! You cannot rely on it being called with the root \ after it is loaded. Reason: Users may have saved a subdirectory to the plugin in the Ctrl+D directory hotlist in a previous session with the plugin.
Note:
Do not thow any other exceptions. Such exception will be passed to Total Commander which cannot handle it.

Exceptions

ExceptionCondition
System.IO..::.DirectoryNotFoundExceptionDirectory does not exists
System..::.UnauthorizedAccessExceptionThe user does not have access to the directory
System.Security..::.SecurityExceptionSecurity error detected
System.IO..::.IOExceptionAnother error occured

See Also