File Info API.

## Typedefs

typedef enum rpmFileTypes_e | rpmFileTypes
| File types. More...
typedef enum rpmFileAction_e | rpmFileAction
| File disposition(s) during package install/erase transaction. More...

## Enumerations

enum | rpmFileTypes_e { PIPE = 1, CDEV = 2, XDIR = 4, BDEV = 6, REG = 8, LINK = 10, SOCK = 12 }
| File types. More...
enum | rpmFileAction_e { FA_UNKNOWN = 0, FA_CREATE, FA_COPYIN, FA_COPYOUT, FA_BACKUP, FA_SAVE, FA_SKIP, FA_ALTNAME, FA_ERASE, FA_SKIPNSTATE, FA_SKIPNETSHARED, FA_SKIPCOLOR }
| File disposition(s) during package install/erase transaction. More...

## Functions

rpmfi | rpmfiLink (rpmfi fi)
| Reference a file info set instance. More...
rpm_count_t | rpmfiFC (rpmfi fi)
| Return file count from file info set. More...
int | rpmfiFX (rpmfi fi)
| Return current file index from file info set. More...
int | rpmfiSetFX (rpmfi fi, int fx)
| Set current file index in file info set. More...
rpm_count_t | rpmfiDC (rpmfi fi)
| Return directory count from file info set. More...
int | rpmfiDX (rpmfi fi)
| Return current directory index from file info set. More...
int | rpmfiSetDX (rpmfi fi, int dx)
| Set current directory index in file info set. More...
const char * | rpmfiBN (rpmfi fi)
| Return current base name from file info set. More...
const char * | rpmfiDN (rpmfi fi)
| Return current directory name from file info set. More...
const char * | rpmfiFN (rpmfi fi)
| Return current file name from file info set. More...
rpmfileAttrs | rpmfiFFlags (rpmfi fi)
| Return current file flags from file info set. More...
rpmVerifyAttrs | rpmfiVFlags (rpmfi fi)
| Return current file verify flags from file info set. More...
rpm_mode_t | rpmfiFMode (rpmfi fi)
| Return current file mode from file info set. More...
rpmfileState | rpmfiFState (rpmfi fi)
| Return current file state from file info set. More...
int | rpmfiDigestAlgo (rpmfi fi)
| Return digest algorithm of a file info set. More...
const unsigned char * | rpmfiFDigest (rpmfi fi, int *algo, size_t *diglen)
| Return current file (binary) digest of file info set. More...
char * | rpmfiFDigestHex (rpmfi fi, int *algo)
| Return current file (hex) digest of file info set. More...
const unsigned char * | rpmfiMD5 (rpmfi fi) RPM_GNUC_DEPRECATED
| Return current file (binary) md5 digest from file info set. More...
const char * | rpmfiFLink (rpmfi fi)
| Return current file linkto (i.e. More...
rpm_loff_t | rpmfiFSize (rpmfi fi)
| Return current file size from file info set. More...
rpm_rdev_t | rpmfiFRdev (rpmfi fi)
| Return current file rdev from file info set. More...
rpm_ino_t | rpmfiFInode (rpmfi fi)
| Return current file inode from file info set. More...
rpm_color_t | rpmfiColor (rpmfi fi)
| Return union of all file color bits from file info set. More...
rpm_color_t | rpmfiFColor (rpmfi fi)
| Return current file color bits from file info set. More...
const char * | rpmfiFClass (rpmfi fi)
| Return current file class from file info set. More...
uint32_t | rpmfiFDepends (rpmfi fi, const uint32_t **fddictp)
| Return current file depends dictionary from file info set. More...
uint32_t | rpmfiFNlink (rpmfi fi)
| Return (calculated) current file nlink count from file info set. More...
rpm_time_t | rpmfiFMtime (rpmfi fi)
| Return current file modify time from file info set. More...
const char * | rpmfiFUser (rpmfi fi)
| Return current file owner from file info set. More...
const char * | rpmfiFGroup (rpmfi fi)
| Return current file group from file info set. More...
const char * | rpmfiFCaps (rpmfi fi)
| Return textual representation of current file capabilities from file info set. More...
const char * | rpmfiFLangs (rpmfi fi)
| Return current file language(s) from file info set. More...
int | rpmfiNext (rpmfi fi)
| Return next file iterator index. More...
rpmfi | rpmfiInit (rpmfi fi, int fx)
| Initialize file iterator index. More...
int | rpmfiNextD (rpmfi fi)
| Return next directory iterator index. More...
rpmfi | rpmfiInitD (rpmfi fi, int dx)
| Initialize directory iterator index. More...
rpmfi | rpmfiFree (rpmfi fi)
| Destroy a file info set. More...
rpmfi | rpmfiNewPool (rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags)
| Create and load a file info set. More...
rpmfi | rpmfiNew (const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags)
| Create and load a file info set. More...
rpmFileTypes | rpmfiWhatis (rpm_mode_t mode)
| Return file type from mode_t. More...
int | rpmfiCompare (const rpmfi afi, const rpmfi bfi)
| Return file info comparison. More...
rpmFileAction | rpmfiDecideFate (const rpmfi ofi, rpmfi nfi, int skipMissing)
| Return file disposition. More...
int | rpmfiConfigConflict (const rpmfi fi)
| Return whether file is conflicting config. More...

## Detailed Description

## Typedef Documentation

typedef enum rpmFileAction_e rpmFileAction

File disposition(s) during package install/erase transaction.

typedef enum rpmFileTypes_e rpmFileTypes

File types.

These are the file types used internally by rpm. The file type is determined by applying stat(2) macros like S_ISDIR to the file mode tag from a header. The values are arbitrary, but are identical to the linux stat(2) file types.

## Enumeration Type Documentation

enum rpmFileAction_e

File disposition(s) during package install/erase transaction.

Enumerator
FA_UNKNOWN | initial action for file ...
FA_CREATE | ... copy in from payload.
FA_COPYIN | ... copy in from payload.
FA_COPYOUT | ... copy out to payload.
FA_BACKUP | ... renamed with ".rpmorig" extension.
FA_SAVE | ... renamed with ".rpmsave" extension.
FA_SKIP | ... already replaced, don't remove.
FA_ALTNAME | ... create with ".rpmnew" extension.
FA_ERASE | ... to be removed.
FA_SKIPNSTATE | ... untouched, state "not installed".
FA_SKIPNETSHARED | ... untouched, state "netshared".
FA_SKIPCOLOR | ... untouched, state "wrong color".

Definition at line 73 of file rpmfi.h.

enum rpmFileTypes_e

File types.

These are the file types used internally by rpm. The file type is determined by applying stat(2) macros like S_ISDIR to the file mode tag from a header. The values are arbitrary, but are identical to the linux stat(2) file types.

Enumerator
PIPE | pipe/fifo
CDEV | character device
XDIR | directory
BDEV | block device
REG | regular file
LINK | hard link
SOCK | socket

Definition at line 24 of file rpmfi.h.

## Function Documentation

const char* rpmfiBN | ( | rpmfi | fi | ) |

Return current base name from file info set.

Parameters

  fi | file info set

Returns
  current base name, NULL on invalid

rpm_color_t rpmfiColor | ( | rpmfi | fi | ) |

Return union of all file color bits from file info set.

Parameters

  fi | file info set

Returns
  current color

int rpmfiCompare | ( | const rpmfi | afi,
|  | const rpmfi | bfi
| ) |  |

Return file info comparison.

Parameters

  afi | 1st file info
  bfi | 2nd file info

Returns
  0 if identical

int rpmfiConfigConflict | ( | const rpmfi | fi | ) |

Return whether file is conflicting config.

Parameters

  fi | file info

Returns
  1 if config file and file on disk conflicts

rpm_count_t rpmfiDC | ( | rpmfi | fi | ) |

Return directory count from file info set.

Parameters

  fi | file info set

Returns
  current directory count

rpmFileAction rpmfiDecideFate | ( | const rpmfi | ofi,
|  | rpmfi | nfi,
|  | int | skipMissing
| ) |  |

Return file disposition.

Parameters

  ofi | old file info
  nfi | new file info
  skipMissing | OK to skip missing files?

Returns
  file disposition

int rpmfiDigestAlgo | ( | rpmfi | fi | ) |

Return digest algorithm of a file info set.

Parameters

  fi | file info set

Returns
  digest algorithm of file info set, 0 on invalid

const char* rpmfiDN | ( | rpmfi | fi | ) |

Return current directory name from file info set.

Parameters

  fi | file info set

Returns
  current directory, NULL on invalid

int rpmfiDX | ( | rpmfi | fi | ) |

Return current directory index from file info set.

Parameters

  fi | file info set

Returns
  current directory index

rpm_count_t rpmfiFC | ( | rpmfi | fi | ) |

Return file count from file info set.

Parameters

  fi | file info set

Returns
  current file count

const char* rpmfiFCaps | ( | rpmfi | fi | ) |

Return textual representation of current file capabilities from file info set.

See cap_from_text(3) for details.

Parameters

  fi | file info set

Returns
  file capability description, "" for no capabilities and NULL on invalid

const char* rpmfiFClass | ( | rpmfi | fi | ) |

Return current file class from file info set.

Parameters

  fi | file info set

Returns
  current file class, 0 on invalid

rpm_color_t rpmfiFColor | ( | rpmfi | fi | ) |

Return current file color bits from file info set.

Parameters

  fi | file info set

Returns
  current file color

uint32_t rpmfiFDepends | ( | rpmfi | fi,
|  | const uint32_t ** | fddictp
| ) |  |

Return current file depends dictionary from file info set.

Parameters

  fi | file info set

Return values

  *fddictp | file depends dictionary array (or NULL)

Returns
  no. of file depends entries, 0 on invalid

const unsigned char* rpmfiFDigest | ( | rpmfi | fi,
|  | int * | algo,
|  | size_t * | diglen
| ) |  |

Return current file (binary) digest of file info set.

Parameters

  fi | file info set

Return values

  algo | digest hash algorithm used (pass NULL to ignore)
  diglen | digest hash length (pass NULL to ignore)

Returns
  current file digest, NULL on invalid

char* rpmfiFDigestHex | ( | rpmfi | fi,
|  | int * | algo
| ) |  |

Return current file (hex) digest of file info set.

The file info set stores file digests in binary format to conserve memory, this converts the binary data back to hex presentation used in headers.

Parameters

  fi | file info set

Return values

  algo | digest hash algorithm used (pass NULL to ignore)

Returns
  current file digest (malloc'ed), NULL on invalid

rpmfileAttrs rpmfiFFlags | ( | rpmfi | fi | ) |

Return current file flags from file info set.

Parameters

  fi | file info set

Returns
  current file flags, 0 on invalid

const char* rpmfiFGroup | ( | rpmfi | fi | ) |

Return current file group from file info set.

Parameters

  fi | file info set

Returns
  current file group, NULL on invalid

rpm_ino_t rpmfiFInode | ( | rpmfi | fi | ) |

Return current file inode from file info set.

Parameters

  fi | file info set

Returns
  current file inode, 0 on invalid

const char* rpmfiFLangs | ( | rpmfi | fi | ) |

Return current file language(s) from file info set.

Parameters

  fi | file info set

Returns
  current file language(s), NULL on invalid

const char* rpmfiFLink | ( | rpmfi | fi | ) |

Return current file linkto (i.e.

symlink(2) target) from file info set.

Parameters

  fi | file info set

Returns
  current file linkto, NULL on invalid

rpm_mode_t rpmfiFMode | ( | rpmfi | fi | ) |

Return current file mode from file info set.

Parameters

  fi | file info set

Returns
  current file mode, 0 on invalid

rpm_time_t rpmfiFMtime | ( | rpmfi | fi | ) |

Return current file modify time from file info set.

Parameters

  fi | file info set

Returns
  current file modify time, 0 on invalid

const char* rpmfiFN | ( | rpmfi | fi | ) |

Return current file name from file info set.

Parameters

  fi | file info set

Returns
  current file name

uint32_t rpmfiFNlink | ( | rpmfi | fi | ) |

Return (calculated) current file nlink count from file info set.

Parameters

  fi | file info set

Returns
  current file nlink count, 0 on invalid

rpm_rdev_t rpmfiFRdev | ( | rpmfi | fi | ) |

Return current file rdev from file info set.

Parameters

  fi | file info set

Returns
  current file rdev, 0 on invalid

rpmfi rpmfiFree | ( | rpmfi | fi | ) |

Destroy a file info set.

Parameters

  fi | file info set

Returns
  NULL always

rpm_loff_t rpmfiFSize | ( | rpmfi | fi | ) |

Return current file size from file info set.

Parameters

  fi | file info set

Returns
  current file size, 0 on invalid

rpmfileState rpmfiFState | ( | rpmfi | fi | ) |

Return current file state from file info set.

Parameters

  fi | file info set

Returns
  current file state, 0 on invalid

const char* rpmfiFUser | ( | rpmfi | fi | ) |

Return current file owner from file info set.

Parameters

  fi | file info set

Returns
  current file owner, NULL on invalid

int rpmfiFX | ( | rpmfi | fi | ) |

Return current file index from file info set.

Parameters

  fi | file info set

Returns
  current file index

rpmfi rpmfiInit | ( | rpmfi | fi,
|  | int | fx
| ) |  |

Initialize file iterator index.

Parameters

  fi | file info set
  fx | file iterator index

Returns
  file info set

rpmfi rpmfiInitD | ( | rpmfi | fi,
|  | int | dx
| ) |  |

Initialize directory iterator index.

Parameters

  fi | file info set
  dx | directory iterator index

Returns
  file info set, NULL if dx is out of range

rpmfi rpmfiLink | ( | rpmfi | fi | ) |

Reference a file info set instance.

Parameters

  fi | file info set

Returns
  new file info set reference

const unsigned char* rpmfiMD5 | ( | rpmfi | fi | ) |

Return current file (binary) md5 digest from file info set.

Deprecated:
  Use rpmfiFDigest() instead

Parameters

  fi | file info set

Returns
  current file md5 digest, NULL on invalid

rpmfi rpmfiNew | ( | const rpmts | ts,
|  | Header | h,
|  | rpmTagVal | tagN,
|  | rpmfiFlags | flags
| ) |  |

Create and load a file info set.

Parameters

  ts | unused
  h | header
  tagN | unused
  flags | Flags to control what information is loaded.

Returns
  new file info set

rpmfi rpmfiNewPool | ( | rpmstrPool | pool,
|  | Header | h,
|  | rpmTagVal | tagN,
|  | rpmfiFlags | flags
| ) |  |

Create and load a file info set.

Parameters

  pool | shared string pool (or NULL for private pool)
  h | header
  tagN | unused
  flags | Flags to control what information is loaded.

Returns
  new file info set

int rpmfiNext | ( | rpmfi | fi | ) |

Return next file iterator index.

Parameters

  fi | file info set

Returns
  file iterator index, -1 on termination

int rpmfiNextD | ( | rpmfi | fi | ) |

Return next directory iterator index.

Parameters

  fi | file info set

Returns
  directory iterator index, -1 on termination

int rpmfiSetDX | ( | rpmfi | fi,
|  | int | dx
| ) |  |

Set current directory index in file info set.

Parameters

  fi | file info set
  dx | new directory index

Returns
  current directory index

int rpmfiSetFX | ( | rpmfi | fi,
|  | int | fx
| ) |  |

Set current file index in file info set.

Parameters

  fi | file info set
  fx | new file index

Returns
  current file index

rpmVerifyAttrs rpmfiVFlags | ( | rpmfi | fi | ) |

Return current file verify flags from file info set.

Parameters

  fi | file info set

Returns
  current file verify flags, 0 on invalid

rpmFileTypes rpmfiWhatis | ( | rpm_mode_t | mode | ) |

Return file type from mode_t.

Parameters

  mode | file mode bits (from header)

Returns
  file type