Octave interface to the compression and uncompression libraries. More...
#include <cstdio>#include <cstring>#include <functional>#include <list>#include <stdexcept>#include <string>#include "Array.h"#include "dir-ops.h"#include "file-ops.h"#include "file-stat.h"#include "glob-match.h"#include "lo-sysdep.h"#include "oct-env.h"#include "str-vec.h"#include "Cell.h"#include "defun-dld.h"#include "defun-int.h"#include "errwarn.h"#include "ov.h"#include "ovl.h"
Go to the source code of this file.
Classes | |
| class | CFile |
| RIIA wrapper for std::FILE*. More... | |
Functions | |
| OCTAVE_EXPORT octave_value_list | Fbzip2 (const octave_value_list &, int) |
| OCTAVE_EXPORT octave_value_list | Fgzip (const octave_value_list &, int) |
| C OCTAVE_EXPORT octave_function * | Gbzip2 (const octave::dynamic_library &shl, bool relative) |
| C OCTAVE_EXPORT octave_function * | Ggzip (const octave::dynamic_library &shl, bool relative) |
| template<typename X > | |
| string_vector | xzip (const Array< std::string > &source_patterns) |
| template<typename X > | |
| string_vector | xzip (const Array< std::string > &source_patterns, const std::function< std::string(const std::string &)> &mk_dest_path) |
| template<typename X > | |
| string_vector | xzip (const Array< std::string > &source_patterns, const std::string &out_dir) |
| template<typename X > | |
| static octave_value_list | xzip (const std::string &fcn_name, const octave_value_list &args) |
Octave interface to the compression and uncompression libraries.
This was originally implemented as an m file which directly called bzip2 and gzip applications. This may look simpler but causes some issues (see bug #43431) because we have no control over the output file:
In addition, because system() does not have a method that allows passing a list of arguments, there is the issue of having to escape filenames.
A solution is to pipe file contents into the applications instead of filenames. However, that solution causes:
Definition in file gzip.cc.
| OCTAVE_EXPORT octave_value_list Fbzip2 | ( | const octave_value_list & | args, |
| int | nargout | ||
| ) |
Definition at line 669 of file gzip.cc.
References err_disabled_feature().
| OCTAVE_EXPORT octave_value_list Fgzip | ( | const octave_value_list & | args, |
| int | nargout | ||
| ) |
Definition at line 623 of file gzip.cc.
References err_disabled_feature().
| C OCTAVE_EXPORT octave_function* Gbzip2 | ( | const octave::dynamic_library & | shl, |
| bool | relative | ||
| ) |
| C OCTAVE_EXPORT octave_function* Ggzip | ( | const octave::dynamic_library & | shl, |
| bool | relative | ||
| ) |
| string_vector xzip | ( | const Array< std::string > & | source_patterns | ) |
| string_vector xzip | ( | const Array< std::string > & | source_patterns, |
| const std::function< std::string(const std::string &)> & | mk_dest_path | ||
| ) |
Definition at line 479 of file gzip.cc.
References concat(), get_dirlist(), glob_match::glob(), Array< T, Alloc >::numel(), string_vector::numel(), tilde_expand(), and unlink().
| string_vector xzip | ( | const Array< std::string > & | source_patterns, |
| const std::string & | out_dir | ||
| ) |
Definition at line 558 of file gzip.cc.
References basename(), concat(), dir_sep_str(), and mkdir().
|
static |
Definition at line 581 of file gzip.cc.
References octave_value_list::length(), octave_value(), and print_usage().