Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

bsdtar can do this! It supports reading an mtree file (a text description of a filesystem or of the contents of an archive) as an input and producing ZIP as an output!

Given an mtree file foo.mtree:

    #mtree
    baz/bar type=file content=quux
You can produce a ZIP containing baz/bar with:

    bsdtar -c --format=zip -f out.zip @foo.mtree
There’s a much better explanation in the bsdtar manual at https://man.freebsd.org/cgi/man.cgi?query=bsdtar&sektion=1&f...

If you’re on Windows, “tar.exe” is bsdtar. With the caveat that the mtree file should be saved with LF line endings, this should still work.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: