When expanding a tar file containing which contains a file inside a subdirectory, the subdirectory is not created (unlike the case with other tar tools).
I attach a tar file which demonstrates this and here's a little script to trigger the error (you need to ungzip the test.tar.gz file first to get test.tar):
#!/usr/bin/env stack
-- stack --resolver lts-13.1 runghc --package tar-conduit --package conduit
module Main where
import qualified Data.Conduit.Tar as CTar
import qualified Conduit as C
import Conduit ((.|))
import qualified Data.ByteString as B
import System.Environment (getArgs)
main :: IO ()
main = do
fs <- getArgs
case fs of
[f] -> C.runConduitRes $
C.sourceFileBS f
.| CTar.untarWithFinalizers (CTar.restoreFileInto ".")
_ -> error "Use a single argument to Expand.hs"
When expanding a tar file containing which contains a file inside a subdirectory, the subdirectory is not created (unlike the case with other tar tools).
I attach a tar file which demonstrates this and here's a little script to trigger the error (you need to ungzip the
test.tar.gz
file first to gettest.tar
):test.tar.gz