<< Click to Display Table of Contents >>
Creates file name with unique body.
ZFERR FAR ZfxCreateAutoFile( ZFSESSIONHANDLE hSession, char FAR *lpszPrefix, char FAR *lpszExtn, char FAR *lpszPath, char FAR *lpszBody)
API session handle, as returned by ZfxAPIInit call lpszPrefix4 character identifier for filelpszExtn1 to 3 character extension for file
Full pathname of directory to contain filelpszBodyAddress of buffer (of length ZFMSG_BODY_LEN+1) to receive body name of file which is created (returned)
This routine creates a file in the given directory, where no other file in the directory has the same body name (ie the part of the file name excluding the extension). The file name created has the form "~ppppnnn.xxx" where pppp and xxx are the prefix name and extension specified in the call, and nnn is a number from 000 to 999 (or can be 3 alphanumeric characters if the directory already contains a large number of matching files).
The routine is used when creating message files to be sent, since each message has a unique body name. It is recommended that the first character of the base name chosen is "X" to guarantee that files created by application programs are not confused with ones created by the Zetafax client (although this is not mandatory).
The routine returns 0 if successful, otherwise one of the following:
if (ZfxGetUserOutDir(hSession, szUserOutDir, sizeof(szUserOutDir)) == 0 && ZfxCreateAutoFile(hSession, "XSUB", "TMP", szUserOutDir, szBody) == 0)
printf("Created file %s%s.TMP\n", szUserOutDir, szBody);