formZ SDK | 5.0 API Reference | Project | File Formats

# fz_file_make_unique_name

Description

Create a unique file name. Given a folder (floc) a base name and an extension, this function produces a unique filename. It replaces illegal file name characters (such as ':', '/', and '\' on Windows) with '_'. It then searches the folder for a file with the same name. if one is found, a unique number is appended to the base name before the file extension is added.

Plugin Prototype

fzrt_error_td fz_file_make_unique_name(

fzrt_floc_ptr | floc,
char * | base_name,
char * | ext,
char * | file_name )

Parameters

floc [Input]

the folder to search for a duplicate file name.

base_name [Input]

a file name without a file extension.

ext [Input]

the file extension.

file_name [Result]

the created unique file name.

Returns

FZRT_NOERR on success. Or:
INTERNAL_ERR - The resulting file name exceeds 31 characters.

Availability

5.0.0.0

Function Set

fz_ffmt_fset

Defined in

fz_ffmt_api.h