NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO
pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW()
#include <libpmemset.h>
int pmemset_source_from_temporaryU(struct pmemset_source **src, const char const char *dir);
int pmemset_source_from_temporaryW(struct pmemset_source **src, const wchar_t const char *dir);
pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() function instantiates a new struct pmemset_source* object describing the data source and creates a unnamed temporary file in the provided directory dir. The temporary file is always created with mode 0600, and the dir must specify an existing directory name. The created file has size 0 and is extended dynamically based on required map size during pmemset_map(3).
In case of source from temporary file the pmemset_source_delete(3) function frees *src and sets *src to NULL and closes the temporary file as a result the file is immediately deleted.
The pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() function return 0 on success or negative error code on failure.
The pmemset_source_from_temporaryU()/pmemset_source_from_temporaryW() can fail with the following errors:
PMEMSET_E_INVALID_SOURCE_PATH - the provided directory path string is NULL or provided path does not exists.
PMEMSET_E_CANNOT_CREATE_TEMP_FILE - cannot create a unique temporary filename.
-ENOMEM - in case of insufficient memory to allocate an instance of struct pmemset_source.
pmemset_map(3), pmemset_source_delete(3), libpmemset(7) and http://pmem.io
The contents of this web site and the associated GitHub repositories are BSD-licensed open source.