View Issue Details

IDProjectCategoryView StatusLast Update
0000699fileGeneralpublic2025-12-07 21:01
Reporterpertusus Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0000699: Info file format not recognized
DescriptionThe current magic information to find Info files in https://github.com/file/file/blob/master/magic/Magdir/tex is:
0 search/1 This\ is\ Info\ file GNU Info text

This string is not in Info files generated by makeinfo or texi2any since at least 2002. The string is like:
This is info-stnd.info, produced by texi2any version 7.2dev from
info-stnd.texi.

The program name can also be "makeinfo" instead of "texi2any".

Using the first line to detect an Info file is not very robust, in the Info format specification at
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Info-Format-Preamble.html
the line is described as:
      An arbitrary string beginning the output file, followed by a blank line.

The following strings could be used to detect an Info file:
INFO-DIR-SECTION
START-INFO-DIR-ENTRY
The happen after the first line and a copying header. However they are optional.

The following should always be present near the beginning of the file, after the first line and a copying header and the INFO-DIR-SECTION/START-INFO-DIR-ENTRY block:
\037\012Indirect:
\037\012File:

The first one is present in the main file if th eInfo file is split, the second is present in the indirect files or in the main and only file if not split.

The following string is also quite specific of Info:
\037\012Tag Table:

For manually written Info files, it could make sense to add the Tag table string to the string looked for.

One of the strings described above should be in the "search/4096" search range. If not, it should be expected that an Info file cannot be easily recognized.
Steps To Reproducefile info-stnd.info
info-stnd.info: data
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2025-12-07 21:01 pertusus New Issue