IFileSystemInfo.Extension

Syntax

Extension: String;

Description

The Extension property returns a file extension including ".".

Example

Sub UserProc;
Var
    Dir: IDirectoryInfo;
    FileSInfo: IFileSystemInfo;
    s: String;
Begin
    Dir:=New DirectoryInfo.Attach("c:\New_folder");
    If Dir.Exists And (Dir.GetFiles("*").Count<>0Then
        s:=Dir.GetFiles("*").Item(0).Extension;
    End If;
    Dispose Dir;
End Sub UserProc;

After executing the example, the "s" variable contains extension of the first file, if the New_folder directory exists and contains files.

See also:

IFileSystemInfo