IO Compression Utilities
[Utilities]
Functions |
int | utr_io_decompress_file (const char *Work_dir, const char *Filename, char *Decompressed_filename) |
| This functions tries to find compressed file and decompress it, in given directory.
|
int | utr_io_compress_file (const char *Work_dir, const char *Filename) |
| This functions tires to find given file and compress it, saving compressed file under the same name, but with ".zip" postfix (e.g. "field0.dmp" will become "field0.dmp.zip").
|
Detailed Description
The IO Compression Utilities provides automatic ZIP compression of all dumped mesh and field files. General assumptions:
- compression and decompression is applied for all I/O operations executed with usage of utilities
- decompression seeks for given filename with or without ".zip" ending (e.g. if in problem definition file a "mesh.dat" filename is given, a "mesh.dat.zip" file is accepted as correct data file and decompressed to "mesh.dat")
- if decompressed file is found with matching name, it will be selected for read
- decompression temporarily creates files in working directory
- dumped files are compressed right after file write is complete
- original (not-compressed) files are auto-deleted at program exit
- if program fails to exit correctly both compressed and uncompressed file can be found in work directory
- compressed files are about 15-30% of the size of not compressed files
- compression is recommended for files > 1MB, and strongly recommended for files > 10MB
The IO Compression Utilities are enabled by default.
/** /** /** /**
Function Documentation
int utr_io_compress_file |
( |
const char * |
Work_dir, |
|
|
const char * |
Filename | |
|
) |
| | |
This functions tires to find given file and compress it, saving compressed file under the same name, but with ".zip" postfix (e.g. "field0.dmp" will become "field0.dmp.zip").
- Parameters:
-
| Work_dir | const char* Working directory - in this path given Filename will be searched. |
| Filename | const char* file to compress |
- Returns:
- int
int utr_io_decompress_file |
( |
const char * |
Work_dir, |
|
|
const char * |
Filename, |
|
|
char * |
Decompressed_filename | |
|
) |
| | |
This functions tries to find compressed file and decompress it, in given directory.
- Parameters:
-
| Work_dir | const char* Working directory - in this path given Filename will be searched. |
| Filename | const char* filename with or without ".zip" ending to decompress. |
| Decompressed_filename | OUT: filename to proceed with, after decompression. |
- Returns:
- int