PMDF Programmer's Reference Manual


Previous Next Contents Index


PMDFgetUniqueString

Generate a unique, eighteen character string.

PASCAL

status = PMDF_get_unique_string (string, string_len)

argument information
Argument Data type Access Mechanism
string descriptor read/write reference
string_len unsigned word write reference

C

status = PMDFgetUniqueString (string, string_len)

argument information


int PMDFgetUniqueString(char *string, int *string_len) 


Arguments

string

String to receive the psuedo-random unique character string. Length must be at least 19 bytes.

string_len

Length in bytes of the unique string. Callers using PMDFgetUniqueString must, on input, supply the maximum length in bytes of the string buffer.

Description

PMDFgetUniqueString will return a psuedo-random character string composed of a fixed number of characters chosen from the thirty-six character alphabet 0, 1, 2, ..., 9, A, B, C, ..., Z. On OpenVMS and Windows systems, this string will be 18 characters long and unique cluster-wide (i.e., no two calls made in the same cluster will generate the same string). On UNIX systems, the string is 14 characters long. PMDFgetUniqueString is a useful utility for programs which need to generate, for instance, unique file names. Note that the generated string can begin with a numeral. Thus, on file systems which require that file names begin with a non-numeric character, a character such as a "A" should be prepended to the string to produce a valid file name. Truncating the string will compromise its uniqueness.

Return Values

PMDF__OK Normal, successful completion.
PMDF__FATERRLIB Call to LIB$SCOPY_R_DX failed owing to a fatal internal error in the OpenVMS Run Time Library. No string returned.
PMDF__INSVIRMEM Insufficient virtual memory: call to LIB$GET_VM made by LIB$SCOPY_R_DX has failed. No string returned.
PMDF__INVSTRDES Invalid string descriptor for string: descriptor has an invalid value in its DSC$B_CLASS field. No string returned.
PMDF__STRTRU Supplied string was too short; value truncated to fit.


Previous Next Contents Index