Commit Graph

15 Commits

Author SHA1 Message Date
f6507e5461
chore: add note to self
untar creates parent dirs only for regular files now, not symlinks/hard links/FIFOs/etc
2023-02-25 20:30:31 +01:00
7e42b10078
fix: Make the untar example create parent directories if they don't exist (like mkdir -p)
This lets it deal with tar archives that are packaged like this:
usr/include/hello.h
usr/include/bye.h
usr/lib/libexample.a
Instead of requiring directory entries:
usr/
usr/include/
usr/include/hello.h (etc)

This helps since some tar archives (our own example tool, pack, for example, does this) are packaged without directory entries.
2023-02-25 20:28:23 +01:00
320231c70b
fix: Make the 'list' example show more metadata 2023-02-09 16:40:57 +01:00
bf52d9e321
fix: Handle malloc errors properly in pack.c 2023-02-05 14:38:31 +01:00
7339aeeae5
chore: Add platform-specific example targets
Someone might want to build only the examples that work on non-POSIX, or the ones that work on POSIX.
2023-02-05 14:33:59 +01:00
40302ddd41
fix: Do not define metadata twice in examples/pack.c 2023-02-05 14:30:29 +01:00
482ac6d949
feat: Add write support
This uses a new struct (struct minitar_w).
This struct is initialized using the minitar_open_w function, and deleted using minitar_close_w.

The functions to write to an archive are minitar_write_file_entry() and minitar_write_special_entry().
The difference is that regular files have content, while the rest (special entries) do not.

This commit also adds a new example program (pack), which can create tar archives from files (no directory support though).

Archives created using pack and minitar can be read and extracted using GNU tar!!

Documentation is coming in another commit.
2023-02-04 19:02:08 +01:00
5b0d597c09
feat: Add support for block and character devices 2023-01-29 22:07:54 +01:00
1f08cf4b31
feat: Add support for FIFOs 2023-01-27 23:00:53 +01:00
3772e9e3a6
feat: Add support for hard links 2023-01-27 22:46:18 +01:00
599cac5811
feat: Add support for symbolic links
All the pieces were in place, we just needed to put them together.

Sorry, but sub-500 LoC isn't gonna work anymore...
2023-01-26 22:12:42 +01:00
56250a226f
chore: Add a CMake target to build all examples 2023-01-19 22:44:01 +01:00
240a4f2f1a
chore: Add examples to CMake as opt-in targets 2023-01-19 22:30:23 +01:00
9a7629459e
chore: Add copyright headers to all source files 2023-01-12 21:04:52 +01:00
e758012948
feat: Add two examples 2023-01-12 20:04:28 +01:00