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