2014-07-03 02:36:10 +00:00
|
|
|
#include <fc/compress/lzma.hpp>
|
|
|
|
|
#include <fc/filesystem.hpp>
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
using namespace fc;
|
|
|
|
|
|
|
|
|
|
int main( int argc, char** argv )
|
|
|
|
|
{
|
2014-07-03 03:28:08 +00:00
|
|
|
if( argc != 2 )
|
2014-07-03 02:36:10 +00:00
|
|
|
{
|
2014-07-03 03:28:08 +00:00
|
|
|
std::cout << "usage: " << argv[0] << " <filename>\n";
|
2014-07-03 02:36:10 +00:00
|
|
|
exit( -1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto src = std::string( argv[1] );
|
2014-07-03 03:28:08 +00:00
|
|
|
auto dst = src + ".compressed";
|
2014-07-03 02:36:10 +00:00
|
|
|
lzma_compress_file( src, dst );
|
|
|
|
|
|
2014-07-03 03:28:08 +00:00
|
|
|
lzma_decompress_file( dst, src + ".decompressed" );
|
|
|
|
|
|
2014-07-03 02:36:10 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|