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

조회 수: 17 (최근 30일)
Chris Endemann
Chris Endemann 2019년 7월 2일
답변: Robert 2022년 5월 18일
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.

답변 (2개)

Yogesh Khurana
Yogesh Khurana 2019년 7월 24일
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
Chris Endemann
Chris Endemann 2019년 7월 24일
I am handing the function a character vector in all cases.
Hemanth Gouru
Hemanth Gouru 2022년 4월 21일
now is there any alternative to untar thta would work properly?

댓글을 달려면 로그인하십시오.


Robert
Robert 2022년 5월 18일
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})

카테고리

Help CenterFile Exchange에서 Structured Data and XML Documents에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by