|
TPCCLIB
|
Header file for libtpcfileutil. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <time.h>#include <unistd.h>#include <dirent.h>#include <sys/stat.h>#include "tpcextensions.h"#include "tpcift.h"Go to the source code of this file.
Functions | |
| int | fileBackup (const char *filename, const char *backup_ext, char *status) |
| int | fileExist (const char *filename) |
| unsigned short int | pathFileNr (const char *pathname) |
| unsigned short int | pathFileList (const char *pathname, IFT *ift) |
| int | pathExist (const char *pathname) |
| int | pathRemove (const char *pathname) |
| int | pathRemoveFiles (const char *pathname) |
| int | pathCreate (const char *pathname) |
Header file for libtpcfileutil.
Requires POSIX compatible compiler. The idea is to isolate system dependent functions from most of the code base to allow easier code changes when necessary.
Definition in file tpcfileutil.h.
|
extern |
Check if specified file exists; rename existing file to a backup file. If also backup file exists, then remove that.
| filename | Name of file which, if it exists, is renamed to a backup file. |
| backup_ext | Extension for backup file; NULL will set the default ".bak" extension. |
| status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
Definition at line 17 of file backup.c.
|
extern |
Check if specified file (not path) exists.
| filename | Name of file to check. |
Definition at line 17 of file filexist.c.
Referenced by anaExists(), dcmFileList(), imgRead(), imgWriteNifti(), micropetExists(), niftiExists(), niftiWriteHeader(), pathCreate(), pathFileList(), pathFileNr(), pathRemove(), and pathRemoveFiles().
|
extern |
Create path.
| pathname | Name of path to create; can contain subdirectories. |
Definition at line 81 of file pathexist.c.
Referenced by imgWriteDICOM(), imgWriteNifti(), and pathCreate().
|
extern |
Check if specified directory (path) exists.
| pathname | Name of path to check. |
Definition at line 17 of file pathexist.c.
Referenced by dcmFileList(), imgFormatFromFName(), imgRead(), imgWriteDICOM(), pathCreate(), pathFileList(), pathFileNr(), pathRemove(), and pathRemoveFiles().
|
extern |
List the names regular files in specified path into IFT structure. File names will contain the directory path.
| pathname | Name of path. |
| ift | Pointer to initiated IFT structure; any previous contents are kept. |
Definition at line 83 of file filexist.c.
Referenced by dcmFileList(), imgRead(), and pathRemoveFiles().
|
extern |
| pathname | Name of path. |
Definition at line 33 of file filexist.c.
Referenced by imgRead(), and imgWriteDICOM().
|
extern |
Remove path.
| pathname | Name of path to remove. |
Definition at line 43 of file pathexist.c.
Referenced by imgWriteDICOM().
|
extern |
Remove regular files in specified path. Subfolders are not affected.
| pathname | Name of path from where to remove files. |
Definition at line 58 of file pathexist.c.