1

I'm putting a release file together, which seems to work fine

1> systools:make_tar("rel/project-1.0").
ok

at that point, I get the expected file at rel/project-1.0.tar.gz, however, trying to extract it errors for some reason

2> erl_tar:extract("rel/project-1.0.tar.gz").
{error,bad_header}

Trying to extract the same file with tar from shell, or with the equivalent os:cmd/1 call, works fine. What's going wrong here?

Inaimathi
  • 13,853
  • 9
  • 49
  • 93

1 Answers1

3

The archive is gzip compressed (notice the .gz extension). You will need to use extract/2 and provide the compressed option:

erl_tar:extract("rel/project-1.0.tar.gz", [compressed]);
Emil Vikström
  • 90,431
  • 16
  • 141
  • 175