|
rpm 6.0.1
The RPM Package Manager
|
File and path manipulation helper functions. More...

Files | |
| file | rpmfileutil.h |
Typedefs | |
| typedef enum rpmCompressedMagic_e | rpmCompressedMagic |
Enumerations | |
| enum | rpmCompressedMagic_e { COMPRESSED_NOT = 0 , COMPRESSED_OTHER = 1 , COMPRESSED_BZIP2 = 2 , COMPRESSED_ZIP = 3 , COMPRESSED_LZMA = 4 , COMPRESSED_XZ = 5 , COMPRESSED_LZIP = 6 , COMPRESSED_LRZIP = 7 , COMPRESSED_7ZIP = 8 , COMPRESSED_GEM = 9 , COMPRESSED_ZSTD = 10 } |
| enum | rpmglobFlags_e { RPMGLOB_NONE = 0 , RPMGLOB_NOCHECK = (1 << 0) } |
Functions | |
| int | rpmDoDigest (int algo, const char *fn, int asAscii, unsigned char *digest) |
| FD_t | rpmMkTemp (char *templ) |
| FD_t | rpmMkTempFile (const char *prefix, char **fn) |
| int | rpmioMkpath (const char *path, mode_t mode, uid_t uid, gid_t gid) |
| int | rpmMkdirs (const char *root, const char *pathstr) |
| char * | rpmCleanPath (char *path) |
| char * | rpmGenPath (const char *urlroot, const char *urlmdir, const char *urlfile) |
| char * | rpmGetPath (const char *path,...) RPM_GNUC_NULL_TERMINATED |
| int | rpmGlobPath (const char *pattern, rpmglobFlags flags, int *argcPtr, ARGV_t *argvPtr) |
| int | rpmGlob (const char *pattern, int *argcPtr, ARGV_t *argvPtr) |
| char * | rpmEscapeSpaces (const char *s) |
| char * | rpmEscape (const char *s, const char *accept) |
| void | rpmUnescape (char *s, const char *accept) |
| int | rpmFileIsCompressed (const char *file, rpmCompressedMagic *compressed) |
| int | rpmFileHasSuffix (const char *path, const char *suffix) |
| char * | rpmGetCwd (void) |
File and path manipulation helper functions.
| typedef enum rpmCompressedMagic_e rpmCompressedMagic |
Compression types detected by rpm (subject to build configuration).
| enum rpmCompressedMagic_e |
Compression types detected by rpm (subject to build configuration).
| enum rpmglobFlags_e |
| char * rpmCleanPath | ( | char * | path | ) |
Canonicalize file path.
| path | path to canonicalize (in-place) |
| int rpmDoDigest | ( | int | algo, |
| const char * | fn, | ||
| int | asAscii, | ||
| unsigned char * | digest ) |
Calculate a file digest and size.
| algo | digest algorithm | |
| fn | file name | |
| asAscii | return digest as ascii string? | |
| [out] | digest | address of calculated digest |
| char * rpmEscape | ( | const char * | s, |
| const char * | accept ) |
Escape given characters in string.
| s | string |
| accept | chars to escape |
| char * rpmEscapeSpaces | ( | const char * | s | ) |
Escape isspace(3) characters in string.
| s | string |
| int rpmFileHasSuffix | ( | const char * | path, |
| const char * | suffix ) |
Check if path (string) ends with given suffix
| path | (path) string |
| suffix | suffix string to check for |
| int rpmFileIsCompressed | ( | const char * | file, |
| rpmCompressedMagic * | compressed ) |
Return type of compression used in file.
| file | name of file | |
| [out] | compressed | address of compression type |
| char * rpmGenPath | ( | const char * | urlroot, |
| const char * | urlmdir, | ||
| const char * | urlfile ) |
Merge 3 args into path. Contrary to what the argument names and older API docs claim, THIS DOES NOT HANDLE URL's.
| urlroot | root URL (often path to chroot, or NULL) |
| urlmdir | directory URL (often a directory, or NULL) |
| urlfile | file URL (often a file, or NULL) |
| char * rpmGetCwd | ( | void | ) |
Like getcwd() but the result is malloced.
| char * rpmGetPath | ( | const char * | path, |
| ... ) |
Return (malloc'ed) expanded, canonicalized, file path.
| path | macro(s) to expand (NULL terminates list) |
| int rpmGlob | ( | const char * | pattern, |
| int * | argcPtr, | ||
| ARGV_t * | argvPtr ) |
Expand a glob pattern into matching paths, fail if nothing matches.
| pattern | glob pattern | |
| [out] | *argcPtr | no. of paths |
| [out] | *argvPtr | ARGV_t array of paths |
| int rpmGlobPath | ( | const char * | pattern, |
| rpmglobFlags | flags, | ||
| int * | argcPtr, | ||
| ARGV_t * | argvPtr ) |
Expand a glob pattern into matching paths. When RPMGLOB_NOCHECK is specified, non-matching and non-glob patterns are returned as is.
| pattern | glob pattern | |
| flags | bit(s) to control glob operation | |
| [out] | *argcPtr | no. of paths |
| [out] | *argvPtr | ARGV_t array of paths |
| int rpmioMkpath | ( | const char * | path, |
| mode_t | mode, | ||
| uid_t | uid, | ||
| gid_t | gid ) |
Insure that directories in path exist, creating as needed.
| path | directory path |
| mode | directory mode (if created) |
| uid | directory uid (if created), or -1 to skip |
| gid | directory uid (if created), or -1 to skip |
| int rpmMkdirs | ( | const char * | root, |
| const char * | pathstr ) |
Create several directories (including parents if needed) in one go. Macros in pathstr will be expanded in the process.
| root | leading root directory (or NULL for none) |
| pathstr | list of directories separated with : |
| FD_t rpmMkTemp | ( | char * | templ | ) |
Thin wrapper for mkstemp(3).
| templ | template for temporary filename |
| FD_t rpmMkTempFile | ( | const char * | prefix, |
| char ** | fn ) |
Return file handle for a temporaray file. A unique temporaray file path will be created in [prefix/]%{_tmppath} directory. The file name and the open file handle are returned.
| prefix | leading part of temp file path | |
| [out] | fn | temp file name (or NULL) |
| void rpmUnescape | ( | char * | s, |
| const char * | accept ) |
Unescape each char listed in accept by removing a backslash preceding it.
| s | string |
| accept | chars to unescape (NULL for all) |