ECONF\_WRITEFILE(3) libeconf Manual ECONF\_WRITEFILE(3)

# [NAME](#NAME)

econf\_writeFile - write configuration to file

# [SYNOPSIS](#SYNOPSIS)

```
#include <libeconf.h>
```

**econf\_err econf\_writeFile(econf\_file \*key\_file, const char \*save\_dir, const char \*file\_name);**

# [DESCRIPTION](#DESCRIPTION)

The **econf\_writeFile**() function writes the configuration information stored in the *key\_file* object to the disk.

The file is saved in the directory specified by *save\_dir* with the name specified by *file\_name*. If the directory or file permissions do not allow writing, the function will fail.

# [RETURN VALUE](#RETURN_VALUE)

Upon successful completion, **ECONF\_SUCCESS** shall be returned.

Otherwise, an error number of type **econf\_err** shall be returned to indicate the error.

# [ERRORS](#ERRORS)

**ECONF\_ARGUMENT\_IS\_NULL\_VALUE**

The value specified by *key\_file* is NULL.

**ECONF\_NOFILE**

Configuration file not found.

**ECONF\_NOMEM**

Out of memory.

**ECONF\_WRITEERROR**

Error creating or writing to a file.

# [SEE ALSO](#SEE_ALSO)

[**libeconf**(3)](/man/os/libeconf/libeconf.3), [**econf\_readFile**(3)](/man/os/libeconf/econf_readFile.3), [**econf\_newIniFile**(3)](/man/os/libeconf/econf_newIniFile.3), [**econf\_free**(3)](/man/os/libeconf/econf_free.3), [**econf\_errString**(3)](/man/os/libeconf/econf_errString.3).

2023-12-14 libeconf

---

Document: econf_writeFile(3) from libeconf 0.8.6-r3 (Chainguard OS)
Source: https://github.com/openSUSE/libeconf
