> For the complete documentation index, see [llms.txt](https://xoops.gitbook.io/xmf-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xoops.gitbook.io/xmf-cookbook/reference/key/filestorage.md).

# FileStorage

The `Xmf\Key\FileStorage` class implements [Xmf\Key\StorageInterface](/xmf-cookbook/reference/key/storageinterface.md) using files in *XOOPS\_VAR\_PATH/data/* directory to persist keys.

## save(*$name*, *$data*)

Save key data *$data* under the name *$name*.

Returns true if successful, otherwise false.

## fetch(*$name*)

Fetch key data stored under the name *$name*.

Returns the stored key data if successful, otherwise false.

## exists(*$name*)

Check for the existence of a key under the name *$name*.

Returns true if a key named *$name* exists, otherwise false.

## delete(*$name*)

Delete a any key stored under the name *$name*.

Returns true if successful, otherwise false.
