Skip to content

ChangeFileExt

Change the extension of a filename.

Declaration

Source position: finah.inc line 22

  function ChangeFileExt(const FileName: UNICODESTRING; 
                        const Extension: UNICODESTRING) : UNICODESTRING;
  function ChangeFileExt(const FileName: RAWBYTESTRING; 
                        const Extension: RAWBYTESTRING) : RAWBYTESTRING;

Description

ChangeFileExt changes the file extension in FileName to Extension. The extension Extension includes the starting . (dot). The previous extension of FileName are all characters after the last ., the . character included.

If FileName doesn't have an extension, Extension is just appended.

Errors

None.

See also

Name Description
ExpandFileName Expand a relative filename to an absolute filename.
ExtractFileExt Return the extension from a filename.
ExtractFileName Extract the filename part from a full path filename.
ExtractFilePath Extract the path from a filename.