Failure to untar() a *.tar.gz file

10 vues (au cours des 30 derniers jours)
Chris Endemann
Chris Endemann le 2 Juil 2019
Réponse apportée : Robert le 18 Mai 2022
For some reason, I am unable to untar a handful of random *.tar.gz files using Matlab's untar() function.
My error message is as follows:
"Error using untar (line 82)
In 'MATLAB:untar:invalidTarFile', data type supplied is incorrect for parameter {0}."
These are local files with no URL involved. I can untar manually just fine using 7zip. Please advise.

Réponses (2)

Yogesh Khurana
Yogesh Khurana le 24 Juil 2019
untar() only accepts character vector or scalar string as data-types for the filename. Please check the data-type of filename you are sending to the function.
For more information please refer to following link:
  2 commentaires
Chris Endemann
Chris Endemann le 24 Juil 2019
I am handing the function a character vector in all cases.
Hemanth Gouru
Hemanth Gouru le 21 Avr 2022
now is there any alternative to untar thta would work properly?

Connectez-vous pour commenter.


Robert
Robert le 18 Mai 2022
Your file is tarred, but also gzipped, so this should work:
myFile = "C:\Files\test.tar.gz";
tarFile = gunzip(myFile); % Gives a cell array of file names.
untar(tarFile{1})

Catégories

En savoir plus sur Software Development Tools dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by