logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

fileutil::magic::filetype - Procedures implementing file-type recognition

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     TcllibTrackers
       [http://core.tcl.tk/tcllib/reportlist].   Please  also report any ideas for enhancements you may have for
       either package and/or documentation.

       When proposing code changes, please provide unifieddiffs, 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.

Category

       Programming tools

tcllib                                                 2.0                       fileutil::magic::filetype(3tcl)

Description

       This package provides a command for the recognition of file types in pure Tcl.

       The  core part of the recognizer was generated from a "magic(5)" file containing the checks to perform to
       recognize files, and associated file-types.

       Beware! This recognizer is large, about 752 Kilobyte of generated Tcl code.

       ::fileutil::magic::filetypefilename
              This command is similar to the command fileutil::fileType.

              Returns a list containing a list of descriptions, a list of mimetype components, and a  list  file
              extensions.  Returns an empty string if the file content is not recognized.

Keywords

       file recognition, file type, file utilities, type

Name

       fileutil::magic::filetype - Procedures implementing file-type recognition

References

       [1]    File(1)sources  [ftp://ftp.astron.com/pub/file/]  This site contains the current sources for the
              file command, including the magic definitions used by it. The latter were used by us  to  generate
              this recognizer.

See Also

file(1), fileutil, magic(5)

Synopsis

       package require Tcl8.69

       package require fileutil::magic::filetype?2.0?::fileutil::magic::filetypefilename

________________________________________________________________________________________________________________

See Also