{
    "content": [
        {
            "type": "text",
            "text": "# File::Type (perldoc)\n\n## NAME\n\nFile::Type - determine file type using magic\n\n## SYNOPSIS\n\nmy $ft = File::Type->new();\n# read in data from file to $data, then\nmy $typefromdata = $ft->checktypecontents($data);\n# alternatively, check file from disk\nmy $typefromfile = $ft->checktypefilename($file);\n# convenient method for checking either a file or data\nmy $type1 = $ft->mimetype($file);\nmy $type2 = $ft->mimetype($data);\n\n## DESCRIPTION\n\nFile::Type uses magic numbers (typically at the start of a file) to determine the MIME type of\nthat file.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **TODO**\n- **BUGS**\n- **SEE ALSO**\n- **ACKNOWLEDGMENTS**\n- **AUTHOR**\n- **COPYRIGHT**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "File::Type",
        "section": "",
        "mode": "perldoc",
        "summary": "File::Type - determine file type using magic",
        "synopsis": "my $ft = File::Type->new();\n# read in data from file to $data, then\nmy $typefromdata = $ft->checktypecontents($data);\n# alternatively, check file from disk\nmy $typefromfile = $ft->checktypefilename($file);\n# convenient method for checking either a file or data\nmy $type1 = $ft->mimetype($file);\nmy $type2 = $ft->mimetype($data);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "TODO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "ACKNOWLEDGMENTS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "File::Type - determine file type using magic\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my $ft = File::Type->new();\n\n# read in data from file to $data, then\nmy $typefromdata = $ft->checktypecontents($data);\n\n# alternatively, check file from disk\nmy $typefromfile = $ft->checktypefilename($file);\n\n# convenient method for checking either a file or data\nmy $type1 = $ft->mimetype($file);\nmy $type2 = $ft->mimetype($data);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "File::Type uses magic numbers (typically at the start of a file) to determine the MIME type of\nthat file.\n\nFile::Type can use either a filename, or file contents, to determine the type of a file.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "new\nReturns a new File::Type object.\n\nmimetype($argument)\nTakes either data or a filename, determines what it is, and passes the argument through to the\nrelevant method below. If the argument is a directory, returns undef.\n\nchecktypefilename($filename)\nOpens $filename (if possible; if not, returns undef) and returns the MIME type of the file.\n\nchecktypecontents($data)\nMatches $data against the magic database criteria and returns the MIME type of the file.\n",
                "subsections": []
            },
            "TODO": {
                "content": "* Add additional magic match criteria\n",
                "subsections": []
            },
            "BUGS": {
                "content": "None known.\n\nNOTES\nSome magic definitions in the mime-magic file used in the creation of this module vary from\nthose in other apps (eg image/x-png not image/png).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "File::MMagic and File::MimeInfo perform the same job, but have a number of problems that led to\nthe creation of this module.\n\nFile::MMagic inlines a copy of the magic database, and uses a DATA filehandle, which causes\nproblems when running under modperl.\n\nFile::MimeInfo uses an external magic file, and relies on file extensions rather than magic to\ndetermine the mime type.\n\nAs a result, File::Type uses a separate module and script to create the code at the core of this\nmodule, which means that there is no need to include a magic database at all, and that it is\nsafe to run under modperl.\n\nFile::Type::Builder, which generates the code at the heart of this module.\n",
                "subsections": []
            },
            "ACKNOWLEDGMENTS": {
                "content": "File::Type is built from a mime-magic file from cleancode.org. The original can be found at\n<http://cleancode.org/cgi-bin/viewcvs.cgi/email/mime-magic.mime?rev=1.1.1.1>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Paul Mison <pmison@fotango.com>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2003-2004 Fotango Ltd.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Licensed under the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}