Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link.of_char: treatment of unknown link indicators #138

Open
reynir opened this issue Jan 11, 2024 · 0 comments
Open

Link.of_char: treatment of unknown link indicators #138

reynir opened this issue Jan 11, 2024 · 0 comments

Comments

@reynir
Copy link
Member

reynir commented Jan 11, 2024

Since it was first introduced unknown-to-us link indicators are treated as normal files:

| _ -> Normal (* if value is malformed, treat as a normal file *)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant