{
    "content": [
        {
            "type": "text",
            "text": "# readdir (info)\n\n## NAME\n\nreaddir - directory input parser for gawk\n\n## SYNOPSIS\n\n@load \"readdir\"\n\n## DESCRIPTION\n\nThe readdir extension adds an input parser for directories.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXAMPLE**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYING PERMISSIONS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "readdir",
        "section": "",
        "mode": "info",
        "summary": "readdir - directory input parser for gawk",
        "synopsis": "@load \"readdir\"",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "@load \"readdir\"",
            "...",
            "BEGIN { FS = \"/\" }",
            "{ print \"file name is\", $2 }"
        ],
        "see_also": [
            {
                "name": "filefuncs",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/filefuncs/3am/json"
            },
            {
                "name": "fnmatch",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/fnmatch/3am/json"
            },
            {
                "name": "fork",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/fork/3am/json"
            },
            {
                "name": "inplace",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/inplace/3am/json"
            },
            {
                "name": "ordchr",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/ordchr/3am/json"
            },
            {
                "name": "readfile",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/readfile/3am/json"
            },
            {
                "name": "revoutput",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/revoutput/3am/json"
            },
            {
                "name": "rwarray",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/rwarray/3am/json"
            },
            {
                "name": "time",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/time/3am/json"
            },
            {
                "name": "opendir",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/opendir/3/json"
            },
            {
                "name": "stat",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/stat/2/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYING PERMISSIONS",
                "lines": 17,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "readdir - directory input parser for gawk\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "@load \"readdir\"\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The readdir extension adds an input parser for directories.\n\nWhen this extension is in use, instead of skipping directories named on\nthe command line (or with getline), they are read, with each entry  re-\nturned as a record.\n\nThe record consists of three fields. The first two are the inode number\nand the filename, separated by a forward slash character.   On  systems\nwhere  the  directory  entry  contains  the file type, the record has a\nthird field which is a single letter indicating the type of the file: f\nfor  file, d for directory, b for a block device, c for a character de-\nvice, p for a FIFO, l for a symbolic link, s for a socket.\n\nOn systems without the file type information, the extension falls  back\nto  calling  stat(2),  in  order  to provide the information.  Thus the\nthird field should never be u.\n\nBy default, if a directory cannot be opened (due  to  permission  prob-\nlems, for example), gawk will exit.  As with regular files, this situa-\ntion can be handled using a BEGINFILE rule that checks ERRNO and prints\nan error or otherwise handles the problem.\n",
                "subsections": []
            },
            "EXAMPLE": {
                "content": "@load \"readdir\"\n...\nBEGIN { FS = \"/\" }\n{ print \"file name is\", $2 }\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "GAWK:   Effective   AWK   Programming,   filefuncs(3am),  fnmatch(3am),\nfork(3am), inplace(3am),  ordchr(3am),  readfile(3am),  revoutput(3am),\nrwarray(3am), time(3am).\n\nopendir(3), readdir(3), stat(2).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Arnold Robbins, arnold@skeeve.com.\n",
                "subsections": []
            },
            "COPYING PERMISSIONS": {
                "content": "Copyright (C) 2012, 2013, 2018, 2019 Free Software Foundation, Inc.\n\nPermission  is  granted  to make and distribute verbatim copies of this\nmanual page provided the copyright notice and  this  permission  notice\nare preserved on all copies.\n\nPermission  is granted to copy and distribute modified versions of this\nmanual page under the conditions for verbatim  copying,  provided  that\nthe  entire  resulting derived work is distributed under the terms of a\npermission notice identical to this one.\n\nPermission is granted to copy and distribute translations of this  man-\nual page into another language, under the above conditions for modified\nversions, except that this permission notice may be stated in a  trans-\nlation approved by the Foundation.\n\nFree Software Foundation          Oct 30 2019                     READDIR(3am)",
                "subsections": []
            }
        }
    }
}