Generate a unique, eighteen character string.
argument informationstatus = PMDF_get_unique_string (string, string_len)
| Argument | Data type | Access | Mechanism |
|---|---|---|---|
| string | descriptor | read/write | reference |
| string_len | unsigned word | write | reference |
argument informationstatus = PMDFgetUniqueString (string, string_len)
int PMDFgetUniqueString (string, string_len)
char *string;
int *string_len;
string
String to receive the psuedo-random unique character string. Length must be at least 18 bytes. (19 bytes for PMDFgetUniqueString.)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.
PMDF_get_unique_string 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 NT 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. PMDF_get_unique_string is a useful utility for programs which need to generate, for instance, unique file names. Note that the generated string may 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. |