Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlSrv_FsGenerateEntryName Function
PHT_SERVER

Automatically generates a unique name for a new directory.

Syntax
PRL_HANDLE PrlSrv_FsGenerateEntryName(
    PRL_HANDLE hServer, 
    PRL_CONST_STR sDirPath, 
    PRL_CONST_STR sFilenamePrefix, 
    PRL_CONST_STR sFilenameSuffix, 
    PRL_CONST_STR sIndexDelimiter
);
File

PrlApiDisp.h

Parameters

hServer
A handle of type PHT_SERVER identifying the Virtuozzo Service.
sDirPath
A full path to the target location (directory).
sFilenamePrefix
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.)
sFilenameSuffix
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.
sIndexDelimiter
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.

Returns

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.

Remarks

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.

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