zlib
The DolphinDB zlib plugin supports zlib compression and decompression from file to file.
Installation (with installPlugin
)
Required server version: DolphinDB 2.00.10 or higher.
Supported OS: Linux x86-64 and Linux_JIT x86-64.
Installation Steps:
(1) Use listRemotePlugins to check plugin information in the plugin repository.
Note: For plugins not included in the provided list, you can install through precompiled binaries or compile from source. These files can be accessed from our GitHub repository by switching to the appropriate version branch.
login("admin", "123456")
listRemotePlugins(, "http://plugins.dolphindb.com/plugins/")
(2) Invoke installPlugin for plugin installation
installPlugin("zlib")
(3) Use loadPlugin to load the plugin before using the plugin methods.
loadPlugin("zlib")
Method References
compressFile
Syntax
compressFile(inputFileName, [level])
Details
The method compresses the input file into a .gz file and returns the file name with a suffix ".gz".
Parameters
- inputFileName: A STRING scalar indicating the name and path of input file.
- level (optional): An integer in range
[-1, 9]
. The default value is -1 (equivalent to level 6). 1 gives best speed, 9 gives best compression, 0 gives no compression.
Examples
Compress /home/jccai/data.txt to /home/jccai/data.txt.gz. If a file with the same name already exists, it will be overwritten.
zlib::compressFile("/home/jccai/data.txt");
decompressFile
Syntax
decompressFile(inputFileName)
Details
The method compresses the input file and returns the file name.
Parameters
- inputFileName: A STRING scalar indicating the name and path of input file, must end up with ".gz".
Examples
Compress /home/jccai/data.txt to /home/jccai/data.txt.gz. If a file with the same name already exists, it will be overwritten.
zlib::decompressFile("/home/jccai/data.txt.gz");