Now this affects reading headers since #129 where we synthesize directory link indicators for "normal" files whose file name end with a slash - this should really only be done for headers using '0' or '\000' as link indicator.
The question is what should we do about unknown-to-us link indicators? Options that come to mind are:
Keep the status quo and pretend they are normal files (IMO undesirable),
Add a Unknown of char constructor. This allows users to handle link indicators that are unknown to ocaml-tar. On the other hand it is a headache for writing as the user can construct e.g. Unknown '\000' which is not actually unknown to us (legacy Normal link indicator).
Error out on unknown-to-us link indicators. This may mean we aren't able to read some archives (incorrectly or not). I'm not sure how widespread these archives are. I am unsure how likely it is to work to pretend an unknown link indicator is a normal file. I think I prefer this option although it is a breaking change.
Since it was first introduced unknown-to-us link indicators are treated as normal files: https://github.com/mirage/ocaml-tar/blob/d1c26890d2645d3db06fe6811db8e138f67ca134/lib/tar.ml#L300
Now this affects reading headers since #129 where we synthesize directory link indicators for "normal" files whose file name end with a slash - this should really only be done for headers using
'0'
or'\000'
as link indicator.The question is what should we do about unknown-to-us link indicators? Options that come to mind are:
Unknown of char
constructor. This allows users to handle link indicators that are unknown to ocaml-tar. On the other hand it is a headache for writing as the user can construct e.g.Unknown '\000'
which is not actually unknown to us (legacyNormal
link indicator).