---
name: "dpns_delreplica"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dpns_delreplica"
---

# dpns\_delreplica(3)

delete a replica for a given file

## NAME

dpns\_delreplica - delete a replica for a given file

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "dpns\_api.h"**

**int dpns\_delreplica (const char \****guid***,** **struct dpns\_fileid \****file\_uniqueid***,** **const char \****sfn***)**

## DESCRIPTION

**dpns\_delreplica** deletes a given replica. An extra check may be obtained by specifying *guid* or *file\_uniqueid*. If both are given, *file\_uniqueid* is used.

- *guid*

  specifies the Grid Unique IDentifier.

- *sfn*

  is either the Site URL or the Physical File Name for the replica.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **ENOENT**

  The named file or replica does not exist.

- **EACCES**

  Search permission is denied on a component of the parent directory or the effective user ID does not match the owner of the file or write permission on the file entry itself is denied.

- **EFAULT**

  *sfn* is a NULL pointer.

- **EINVAL**

  The length of *guid* exceeds **CA\_MAXGUIDLEN**.

- **ENAMETOOLONG**

  The length of *sfn* exceeds **CA\_MAXSFNLEN**.

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SECOMERR**

  Communication error.

- **ENSNACT**

  Name server is not running or is being shutdown.

## SEE ALSO

**[Castor\_limits(4)](/Castor_limits/4.md)**, **[dpns\_addreplica(3)](/dpns_addreplica/3.md)**, **[dpns\_listreplica(3)](/dpns_listreplica/3.md)**
