---
name: "njb_datafile_struct"
section: "3"
platform: "linux"
package: "libnjb-doc"
version: "2.2.5-4.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/njb_datafile_struct"
---

# njb\_datafile\_struct(3)

## NAME

njb\_datafile\_struct -

## SYNOPSIS

`#include <libnjb.h>`

### Data Fields

char \* **filename**\
 char \* **folder**\
 u\_int32\_t **timestamp**\
 u\_int32\_t **flags**\
 u\_int32\_t **dfid**\
 u\_int64\_t **filesize**\
 **njb\_datafile\_t** \* **nextdf**\

## Detailed Description

This is the struct storing the metadata of a regular file or folder.

**Examples:**

**files.c**, and **getfile.c**.

## Field Documentation

### u\_int32\_t njb\_datafile\_struct::dfid The 32-bit unsigned file ID.

**Examples:**  **files.c**, and **getfile.c**.

### char\* njb\_datafile\_struct::filename The name of this file. The name '.' means that this is an empty folder name marker.

**Examples:**  **files.c**.

Referenced by datafile\_pack(), datafile\_pack3(), datafile\_set\_name(), datafile\_unpack(), and NJB\_Datafile\_Destroy().

### u\_int64\_t njb\_datafile\_struct::filesize The file size as a 64-bit unsigned integer. The files on series 3 devices only have 32-bit signed length (and can only be 2GB in size) but the NJB1 supports 64-bit length.

**Examples:**  **files.c**, and **getfile.c**.

Referenced by datafile\_pack(), datafile\_pack3(), datafile\_set\_size(), datafile\_size(), and datafile\_unpack().

### u\_int32\_t njb\_datafile\_struct::flags These are ordinary windows file flags:

```
 bit (from MSB)   meaning
 -----------------------------
 31               Normal file (0x80000000U)
 29               This file should be archived (0x20000000U)
 28               Directory (0x10000000U)
 26               System file (0x04000000U)
 25               Hidden file (0x02000000U)
 24               Read only file (0x01000000U)
 22               Encrypted file (0x00400000U)
 21               Normal file? (0x00200000U)
 19               Compressed file (0x00080000U)
 17               Sparse file (0x00020000U)
 16               Temporary file (0x00010000U)
```

SAMBA maps the bits to Unix permissions thus:

```
  owner        group        world
  r  w  x      r  w  x      r  w  x
  ^  ^  ^            ^            ^
  |  |  |            |            |
  |  |  Archive      System       Hidden
  |  |
  Read only
```

The meaning of bits 30, 27, 23, 20 and 15-0 is unknown.

**Examples:**  **files.c**.

Referenced by datafile\_unpack().

### char\* njb\_datafile\_struct::folder This is the name of the folder the file belongs in. All folder names are given with full hierarchy and leading and trailing backslash as in: '\\foo\\bar\\fnord\\'. If filename is '.' this is the name of the empty folder.

**Examples:**  **files.c**.

Referenced by datafile\_pack3(), datafile\_set\_folder(), datafile\_unpack(), and NJB\_Datafile\_Destroy().

### njb\_datafile\_t\* njb\_datafile\_struct::nextdf This is only to be used internally by libnjb.

### u\_int32\_t njb\_datafile\_struct::timestamp This is an ordinary UNIX styled timestamp for the file.

Referenced by datafile\_pack3(), and datafile\_set\_time().

## Author

Generated automatically by Doxygen for libnjb from the source code.
