From 6e65b0a7fb0df5c1c8bfa7855a42bbb7d10b044e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 27 Apr 2023 12:06:26 +0200 Subject: [PATCH] update info about gunzip (#547) --- +bids/copy_to_derivative.m | 6 ++++-- README.md | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/+bids/copy_to_derivative.m b/+bids/copy_to_derivative.m index e38a75e2..feaa29c1 100644 --- a/+bids/copy_to_derivative.m +++ b/+bids/copy_to_derivative.m @@ -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 @@ -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); diff --git a/README.md b/README.md index e6c9d31c..d1b96b51 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [BIDS for MATLAB / Octave](#bids-for-matlab--octave) + - [Requirements](#requirements) - [Installation](#installation) - [Get the latest features](#get-the-latest-features) - [Features](#features) @@ -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) @@ -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.