1. Most TODOs live in the TODO section of doc/ (i.e. file(1)).
  2. They are more visible there, so please add any further TODOs to that
  3. file, not here. More speculative material can live here.
  4. (This change was made when Reuben Thomas noticed that all the bugs
  5. listed in the BUGS section of the man page had been fixed!)
  6. ---
  7. It would be nice to simplify file considerably. For example,
  8. reimplement the apprentice and non-pattern magic methods in Python,
  9. and compile the magic patterns to a giant regex (or something similar;
  10. maybe using Ragel ( so that only a
  11. small amount of C is needed (because fast execution is typically only
  12. required for soft magic, not the more detailed information given by
  13. hard-wired routines). In this regard, note that hplip, which is
  14. BSD-licensed, has a magic reimplementation in Python.
  15. ---
  16. Read the kerberos magic entry for more ideas.
  17. ---
  18. Write a string merger to make magic entry sizes dynamic.
  19. Strings will be converted to offsets from the string table.
  20. ---
  21. Programming language support, we can introduce the concept of a group
  22. of rules where n rules need to match before the rule is positive. This
  23. could require structural changes to the matching code :-(
  24. 0 group 2 # require 2 matches
  25. # rule 1
  26. >0 ....
  27. ...
  28. # rule 2
  29. >0 ....
  30. ...
  31. ---
  32. - Merge the stat code dance in one place and keep it in one place
  33. (perhaps struct buffer).
  34. - Enable seeking around if offset > nbytes if possible (the fd
  35. is seekable).
  36. - We could use file_pipe2file more (for EOF offsets, CDF documents),
  37. but that is expensive; perhaps we should provide a way to disable it
  38. - The implementation of struct buffer needs re-thinking and more work.
  39. For example we don't always pass the fd in the child. This is not
  40. important yet as we don't have yet cases where use/indirect magic
  41. needs negative offsets.
  42. - Really the whole thing just needs here's an (offset, buffer, size)
  43. you have (filebuffer, filebuffersize &&|| fd), fill the buffer with
  44. data from offset. The buffer API should be changed to just do that.
  45. christos