Storage_OpenMutableFile Function

Header: #include <applibs/storage.h>

Retrieves a file descriptor to the mutable storage file for the application. If the application doesn't already have a mutable storage file, this function creates a file and then returns the file descriptor.

A mutable storage file stores and persists data over a device reboot or system update.

int Storage_OpenMutableFile(void);

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EACCES: The application does not have the required application manifest capability (MutableStorage).

  • EIO: An error occurred while trying to create the file.

Any other errno may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.

Return value

Returns a file descriptor to the mutable storage file; or -1 for failure, in which case errno is set to the error.

Application manifest requirements

The application manifest must include the MutableStorage capability.

Concepts and samples