MKI_FileSetExtension (File I/O) Changed in Version 2014.2

www.CAD6.com

C++ Syntax

bool

MKI_FileSetExtension(

 const LPCWSTR f_pszOldName,

 MKI_FILENAMEW& f_rNewName,

 const LPCWSTR f_pszExtension );

 

Sets a file name's extension to a given extension.

 

Parameters

OldName

[const LPCWSTR] Address of file name to be modified. This file name may have an extension.

NewName

[MKI_FILENAMEW&] Address of text buffer to receive the modified file name.

Extension

[const LPCWSTR] Extension to be added to the given file name, with or without a leading point, e.g. "EXT" or ".EXT" . If Extension is either nullptr or points to an empty string, the current file name's extension will be removed without adding a new extension.

 

Return Value

Returns true if successful, false if not.

 

Comment

This procedure will work for all types of file systems (FAT, Enhanced FAT, NTFS, HPFS).

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH