SplitPath

Description:              This statement breaks up a file path name into its components.

Returns:                    Nothing (path components are returned in the parameters)

Usage:                   Script or Steady State

Format:                      SplitPath(FullName, Drive, Path, File, Extension)

Parameters:             FullName     { text }  { required }  { no default: }

                                                Any text expression giving the full path name.

                                    Drive     { text }  { required }  { no default: }

                                                Any variable, which is set to the drive letter in FullName, plus a colon. If FullName doesn't contain a drive specification, Drive is a null string. If this information is not required, a constant may be used for this parameter.

                                    Path     { text }  { required }  { no default: }

                                                Any variable, which is set to the directory path in FullName, ending in a backslash. If FullName doesn't contain a path specification, Path is a null string. If this information is not required, a constant may be used for this parameter.

                                    File     { text }  { required }  { no default: }

                                                Any variable, which is set to the file name in FullName. If FullName doesn't specify a file name, File is a null string. If this information is not required, a constant may be used for this parameter.

                                    Extension     { text }  { required }  { no default: }

                                                Any variable, which is set to the file extension in FullName, including a period). If FullName doesn't specify a file extension, Extension is a null string. If this information is not required, a constant may be used for this parameter.

Examples:

SplitPath("C:\MyApps\App1\Info.TXT", drv, pth, fName, ext);

The values of drv, pth, fName and ext will be "C:", "\MyApps\App1\", "Info" and ".TXT" respectively.

SplitPath("D:\Apps\Profiler\GDI.WIF", drv, pth, 0, 0);

appPath = Concat(drv, pth);

Notice how parameters for retrieving data that is not required are given constant values.

See Also:

Dir | FileFind