Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] specify the required version of gunzip for copying files on unix system #547

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions +bids/copy_to_derivative.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function copy_to_derivative(varargin)
%
% :param unzip: If ``true`` then all ``.gz`` files will be unzipped
% after being copied.
% For MacOS and Unix system, this will require a
% version of gunzip >= 1.6.
% :type unzip: logical
%
% :param force: If set to ``false`` it will not overwrite any file already
Expand Down Expand Up @@ -304,9 +306,9 @@ function copy_with_symlink(src, target, unzip_files, verbose)
if isunix

if unzip_files && is_gunzipped(src)
command = sprintf('gunzip -kfc %s > %s', src, target(1:end - 3));
command = sprintf('gunzip --keep --force --stdout %s > %s', src, target(1:end - 3));
else
command = sprintf('cp -R -L -f %s %s', src, target);
command = sprintf('cp --recursive --dereference --force %s %s', src, target);
end

status = system(command);
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<!-- markdown-link-check-enable -->

- [BIDS for MATLAB / Octave](#bids-for-matlab--octave)
- [Requirements](#requirements)
- [Installation](#installation)
- [Get the latest features](#get-the-latest-features)
- [Features](#features)
Expand All @@ -22,7 +23,7 @@
- [What will this toolbox most likely never do](#what-will-this-toolbox-most-likely-never-do)
- [Usage](#usage)
- [Demos](#demos)
- [Requirements](#requirements)
- [Requirements](#requirements-1)
- [Reading and writing JSON files](#reading-and-writing-json-files)
- [Implementation](#implementation)
- [Get in touch](#get-in-touch)
Expand All @@ -39,6 +40,11 @@ For more information about BIDS, visit https://bids.neuroimaging.io/.
See also [PyBIDS](https://github.com/bids-standard/pybids) for Python and the
[BIDS Starter Kit](https://github.com/bids-standard/bids-starter-kit).

## Requirements

For MacOS and Unix system, using `bids.copy_to_derivative` requires
a version of gunzip >= 1.6.

## Installation

Download, unzip this repository and add its content to the MATLAB/Octave path.
Expand Down