---
name: "NJB_Set_TmpDir"
section: "3"
platform: "linux"
package: "libnjb1-doc"
version: "1.1-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/NJB_Set_TmpDir"
---

# NJB\_Set\_TmpDir(3)

Get and set the temporary directory location for file transfers

## NAME

NJB\_Get\_TmpDir, NJB\_Set\_TmpDir - Get and set the temporary directory location for file transfers

## LIBRARY

libnjb

## SYNOPSIS

\#include \<libnjb.h\>

extern int njb\_error

const char \*NJB\_Get\_TmpDir (njb\_t **\*njb**)

int NJB\_Set\_TmpDir (njb\_t **\*njb**, const char **\*dir**)

## DESCRIPTION

NJB\_Set\_TmpDir sets the temporary location for file downloads made by the  [**NJB\_Get\_Track**(3)](/NJB_Get_Track/3.md) and **NJB\_Get\_Datafile**(3) functions.  NJB\_Get\_TmpDir returns the current setting.

The temporary directory is initially set to /tmp when  [**NJB\_Open**(3)](/NJB_Open/3.md) is called.

## RETURN VALUES

NJB\_Set\_TmpDir returns 0 on success.  If an error occurred, it returns -1 and sets **njb\_error**.

- EO\_NOMEM

  There was not enough memory available to save the new directory location.

## SEE ALSO

NJB\_Get\_Datafile(3), [NJB\_Get\_Track(3)](/NJB_Get_Track/3.md), [NJB\_Open(3)](/NJB_Open/3.md)
