zoo_create

\brief create a node synchronously.

This method will create a node in ZooKeeper. A node can only be created if it does not already exists. The Create Flags affect the creation of nodes. If ZOO_EPHEMERAL flag is set, the node will automatically get removed if the client session goes away. If the ZOO_SEQUENCE flag is set, a unique monotonically increasing sequence number is appended to the path name.

\param zh the zookeeper handle obtained by a call to \ref zookeeper_init \param path The name of the node. Expressed as a file name with slashes separating ancestors of the node. \param value The data to be stored in the node. \param valuelen The number of bytes in data. To set the data to be NULL use value as NULL and valuelen as -1. \param acl The initial ACL of the node. The ACL must not be null or empty. \param flags this parameter can be set to 0 for normal create or an OR of the Create Flags \param path_buffer Buffer which will be filled with the path of the new node (this might be different than the supplied path because of the ZOO_SEQUENCE flag). The path string will always be null-terminated. This parameter may be NULL if path_buffer_len = 0. \param path_buffer_len Size of path buffer; if the path of the new node (including space for the null terminator) exceeds the buffer size, the path string will be truncated to fit. The actual path of the new node in the server will not be affected by the truncation. The path string will always be null-terminated. \return one of the following codes are returned: ZOK operation completed successfully ZNONODE the parent node does not exist. ZNODEEXISTS the node already exists ZNOAUTH the client does not have permission. ZNOCHILDRENFOREPHEMERALS cannot create children of ephemeral nodes. ZBADARGUMENTS - invalid input parameters ZINVALIDSTATE - zhandle state is either ZOO_SESSION_EXPIRED_STATE or ZOO_AUTH_FAILED_STATE ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory

extern (C)
int
zoo_create
(,
const char* path
,
const char* value
,,,
int flags
,,)

Meta