---
name: "pdb_Read"
section: "3"
platform: "linux"
package: "coldsync"
version: "3.0+pre3-3"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/pdb_Read"
---

# pdb\_Read(3)

read, write Palm database files

## NAME

**pdb\_Read** **pdb\_Write** – read, write Palm database files

## LIBRARY

*libpdb*

## SYNOPSIS

**#include \<pdb.h\>**

*struct* *pdb* *\**\

**pdb\_Read**(*int fd*);

*int*\

**pdb\_Write**(*const struct pdb \*db*, *int fd*);

## DESCRIPTION

**pdb\_Read** reads a Palm PDB or PRC file from the file descriptor *fd*, which must already have been opened for reading. *fd* must be seekable.

**pdb\_Read** allocates a new *struct* *pdb* and returns a pointer to it. This should later be freed using **free\_pdb**().

**pdb\_Write**() writes the PDB pointed to by *db* to the file descriptor *fd*, which must already be opened for writing. *fd* need not be seekable.

## RETURN VALUE

**pdb\_Read** returns a pointer to a newly-allocated *struct* *pdb* if successful, or NULL in case of error.

**pdb\_Write** returns 0 if successful, or a negative value in case of error.

## SEE ALSO

[libpdb(3)](/libpdb/3.md), [new\_pdb(3)](/new_pdb/3.md), [free\_pdb(3)](/free_pdb/3.md).
