---
name: "memcached_dump"
section: "3"
platform: "linux"
package: "libmemcached-awesome"
version: "1.1.4-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/memcached_dump"
---

# memcached\_dump(3)

libmemcached Documentation

## NAME

memcached\_dump - libmemcached Documentation

## SYNOPSIS

- **#include \<libmemcached/memcached.h\>**

  Compile and link with -lmemcached

- **typedef memcached\_return\_t \<#\_CPPv418memcached\_return\_t\> (\*memcached\_dump\_fn)(memcached\_st \<#\_CPPv412memcached\_st\> \*ptr, const char \*key, size\_t key\_length, void \*context)**

  - **Param ptr**

    pointer to **memcached\_st** \<#\_CPPv412memcached\_st\> object

  - **Param key**

    key string being dumped

  - **Param key\_length**

    length of the key without any terminating zero

  - **Param context**

    pointer to the user supplied context

  - **Returns**

    **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> indicating success

- **memcached\_return\_t \<#\_CPPv418memcached\_return\_t\> memcached\_dump(memcached\_st \<#\_CPPv412memcached\_st\> \*ptr, memcached\_dump\_fn \*function, void \*context, uint32\_t number\_of\_callbacks)**

  - **Parameters**

    - •

      **ptr** -- pointer to initialized **memcached\_st** \<#\_CPPv412memcached\_st\> struct

    - •

      **function** -- pointer to **number\_of\_callbacks** **memcached\_dump\_fn** callbacks

    - •

      **context** -- pointer to a user managed context

    - •

      **number\_of\_callbacks** -- number of callbacks in the **function** array

  - **Returns**

    **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> indicating success

## DESCRIPTION

**memcached\_dump()** is used to get a list of keys found in **[memcached(1)](/memcached/1.md) \<https://linux.die.net/man/1/memcached\>** servers. Because memcached does not guarantee to dump all keys you can not assume you have fetched all keys from the server. The function takes an array of callbacks that it will use to execute on keys as they are found.

Currently the binary protocol is not tested.

## RETURN VALUE

A value of type **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> is returned. On success that value will be **MEMCACHED\_SUCCESS** \<#\_CPPv4N18memcached\_return\_t17MEMCACHED\_SUCCESSE\>. Use **memcached\_strerror()** \<#\_CPPv418memcached\_strerrorP12memcached\_st18memcached\_return\_t\> to translate this value to a printable string.

## SEE ALSO

**[memcached(1)](/memcached/1.md) \<https://linux.die.net/man/1/memcached\>** **[libmemcached(3)](/libmemcached/3.md) \<https://linux.die.net/man/3/libmemcached\>** **[memcached\_strerror(3)](/memcached_strerror/3.md) \<https://linux.die.net/man/3/memcached\_strerror\>**
