Functions | |
bool | TarballSetup (char *cAppPath) |
Verifies that gzip and tar are where we expect them to be (in the same directory as the executable). | |
void | ZipFile (char *cFileName, char *cAppPath) |
Zips a file with GZIP. | |
void | AddFileToTarball (char *cTarball, char *cFileToAdd, char *cAppPath) |
Adds a file to the end of a tarball. | |
void | AddFileToNewTarball (char *cTarball, char *cFileToAdd, char *cAppPath) |
Creates a new tarball and adds a file to it. | |
void | DeleteThisFile (char *cFile) |
Deletes a file. | |
bool | DoesFileExist (char *cFile) |
Checks for the existence of a file. | |
void | LaunchProcess (char *cFile, char *cArgs, char *cDir) |
Launches a process and waits for it to finish. |
Copyright 2003 Charles D. Canham.
void AddFileToNewTarball | ( | char * | cTarball, | |
char * | cFileToAdd, | |||
char * | cAppPath | |||
) |
Creates a new tarball and adds a file to it.
Any existing tarball of that name will be overwritten. If the tarball does not exist, it will be created. The file to add can be either zipped or not zipped.
cTarball | File name of tarball | |
cFileToAdd | File name of the file to add to the tarball | |
cAppPath | Path to the main application, ending with the path separator. The TAR executable is expected to be in the same path. |
void AddFileToTarball | ( | char * | cTarball, | |
char * | cFileToAdd, | |||
char * | cAppPath | |||
) |
Adds a file to the end of a tarball.
If the tarball does not exist, it will be created. The file to add can be either zipped or not zipped.
cTarball | File name of tarball | |
cFileToAdd | File name of the file to add to the tarball | |
cAppPath | Path to the main application, ending with the path separator. The TAR executable is expected to be in the same path. |
void DeleteThisFile | ( | char * | cFile | ) |
Deletes a file.
cFile | File name of the file to delete |
bool DoesFileExist | ( | char * | cFile | ) |
Checks for the existence of a file.
cFile | File name of the file to check for existence |
void LaunchProcess | ( | char * | cFile, | |
char * | cArgs, | |||
char * | cDir | |||
) |
Launches a process and waits for it to finish.
cFile | Executable to launch | |
cArgs | Arguments to pass to process | |
cDir | Working directory |
bool TarballSetup | ( | char * | cAppPath | ) |
Verifies that gzip and tar are where we expect them to be (in the same directory as the executable).
This should be called before either of the functions below and a fatal error thrown if it returns false.
cAppPath | Path to the main application, ending with the path separator. The executables are expected to be in the same path. |
void ZipFile | ( | char * | cFileName, | |
char * | cAppPath | |||
) |
Zips a file with GZIP.
If the file does not exist, the function does nothing.
cFileName | File to zip. | |
cAppPath | Path to the main application, ending with the path separator. The GZIP executable is expected to be in the same path. |