Sign in Join
FPDoc Onlineexperiment

ExtractFilePath function

In unit sysutils

Extract the path from a filename.

Declaration

pascal
function ExtractFilePath(const FileName: UnicodeString): UnicodeString

Description

ExtractFilePath returns the path part (including drive letter) from FileName. The path consists of all characters before the last directory separator character ('/' or '\'), including the directory separator itself. In case there is only a drive letter, that will be returned.

The full filename can always be reconstructed by concatenating the result of ExtractFilePath and ExtractFileName.

For an example, see ExtractFileDir.

Errors

None.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.