Tcl Library Source Code

Bounty program for improvements to Tcl and certain Tcl packages.

[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


fileutil::magic::rt - Runtime core for file type recognition engines written in pure Tcl

Table Of Contents


package require Tcl 8.5
package require fileutil::magic::rt ?2.0?

::fileutil::magic::rt::new chan named analyze
::fileutil::magic::rt::file_start name
::fileutil::magic::rt::emit msg
::fileutil::magic::rt::O where
::fileutil::magic::rt::R where
::fileutil::magic::rt::Nv type offset compinvert comp expected
::fileutil::magic::rt::N type offset testinvert compinvert mod mand comp expected
::fileutil::magic::rt::S type offset testinvert mod mand comp val
::fileutil::magic::rt::L newlevel
::fileutil::magic::rt::I offset it ioi ioo iir io
::fileutil::magic::rt::R offset
::fileutil::magic::rt::U fileindex name


This package provides the runtime core for file type recognition engines written in pure Tcl and is thus used by all other packages in this module such as fileutil::magic::filetype and the two compiler packages fileutil::magic::cgen and fileutil::magic::cfront.



All of the types above exit in an unsigned form as well. The type names are the same, with the character "u" added as prefix.

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category fileutil :: magic of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


file(1), fileutil, magic(5)


file recognition, file type, file utilities, mime, type


Programming tools