Collapse All
Virtuozzo Virtualization SDK C API Reference
PrlSrv_FsGenerateEntryName Function

Automatically generates a unique name for a new directory.

PRL_HANDLE PrlSrv_FsGenerateEntryName(
    PRL_HANDLE hServer, 
    PRL_CONST_STR sDirPath, 
    PRL_CONST_STR sFilenamePrefix, 
    PRL_CONST_STR sFilenameSuffix, 
    PRL_CONST_STR sIndexDelimiter



A handle of type PHT_SERVER identifying the Virtuozzo Service.
A full path to the target location (directory).
Specifies a prefix to use in the directory name. Pass null or empty string to use the default prefix: tmpfile. The name will be generated by adding a number to the prefix (e.g. tmpfile1, tmpfile2, tmpfile3, etc.)
Specifies a suffix to use in the directory name. Pass null or an empty string value if you don't want to use a suffix.
A character(s) that will be inserted between the prefix and the index (e.g. tmpfile_1, tmpfile_2, tmpfile_3, etc). You can specify a null pointer or an empty string if you don't want to insert any extra characters there.


A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.


The function allows to generate directory names using a specified prefix and optionally a suffix. You can specify your own prefix or use the default one. The function will not create the directories on the host. To create the directories, use the PrlSrv_FsCreateDir function. 

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are: 

PRL_ERR_INVALID_ARG - invalid server handle was passed or invalid path was specified. 

PRL_ERR_SUCCESS - function completed successfully. 

To get the results from the PHT_JOB object:

  1. Use the PrlJob_GetResult function to obtain a handle to the PHT_RESULT object.
  2. Use the PrlResult_GetParamAsString function to obtain the file system entry name from the PHT_RESULT object. The directory name is returned as a UTF-8 encoded, null-terminated string.

Copyright ©2016-2017 Parallels International GmbH. All rights reserved.