---
name: "xdf_prepare_transfer"
section: "3"
platform: "linux"
package: "libxdffileio-dev"
version: "0.3-4+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/xdf_prepare_transfer"
---

# xdf\_prepare\_transfer(3)

Setup the internals of the xDF file to be ready to receive or send data.

## NAME

xdf\_prepare\_transfer - Setup the internals of the xDF file to be ready to receive or send data.

## SYNOPSIS

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

**int xdf\_prepare\_transfer(struct xdf\*** *xdf***);**\

## DESCRIPTION

**xdf\_prepare\_transfer**() set up the internal structures of the xDF file referenced by *xdf* to be ready to receive or send data. After a successful call to it, you can call [**xdf\_write**(3)](/xdf_write/3.md) or [**xdf\_read**(3)](/xdf_read/3.md) depending of the mode of the xDF file.

Since this function prepares the transfer, no call to any function which configures it will be allowed anymore after [**xdf\_define\_arrays**(3)](/xdf_define_arrays/3.md) succeed. In particular, [**xdf\_set\_conf**(3)](/xdf_set_conf/3.md), **xdf\_setchconf**(3) and [**xdf\_define\_arrays**(3)](/xdf_define_arrays/3.md) will fail afterwards.

In case of failure due to I/O (file to big, connection to file system lost...), the best procedure is to close the file since the underlying file will be in a undertermined stated.

## RETURN VALUE

**xdf\_define\_arrays**() returns 0 in case of success. Otherwise -1 is returned and *errno* is set appropriately.

## ERRORS

- **EINVAL**

  *xdf* is NULL.

- **ENOMEM**

  The system is unable to allocate memory resources.

- **EFBIG**

  An attempt was made to write a file that exceeds the implementation-defined maximum file size or the process's file size limit, or to write at a position past the maximum allowed offset.

- **EINTR**

  The call was interrupted by a signal before any data was written; see [**signal**(7)](/signal/7.md).

- **EIO**

  A low-level I/O error occurred while modifying the inode.

- **ENOSPC**

  The device containing the xDF file has no room for the data.

- **ESTALE**

  Stale file handle. This error can occur for NFS and for other file systems

## SEE ALSO

[**xdf\_define\_arrays**(3)](/xdf_define_arrays/3.md), [**xdf\_set\_conf**(3)](/xdf_set_conf/3.md), [**xdf\_set\_chconf**(3)](/xdf_set_chconf/3.md), [**xdf\_read**(3)](/xdf_read/3.md), [**xdf\_write**(3)](/xdf_write/3.md)
