---
name: "msr_duplicate"
section: "3"
platform: "linux"
package: "libmseed-doc"
version: "2.19.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/msr_duplicate"
---

# msr\_duplicate(3)

Duplicate an MSRecord structure

## NAME

msr\_duplicate - Duplicate an MSRecord structure

## SYNOPSIS

```
#include <libmseed.h>
MSRecord *msr_duplicate ( MSRecord *msr, flag datadup );
```

## DESCRIPTION

**msr\_duplicate** creates a copy of an MSRecord structure including all sub-structures (FSDH and blockette chain).  If the *datadup* flag is true the data samples from *msr* will also be duplicated, otherwise the copy MSRecord will not have any associated data sample array regardless if the source MSRecord had any.

## RETURN VALUE

**msr\_duplicate** returns a pointer to an MSRecord on success and NULL on error.

## SEE ALSO

**[ms\_intro(3)](/ms_intro/3.md)**

## AUTHOR

```
Chad Trabant
IRIS Data Management Center
```
