{
    "content": [
        {
            "type": "text",
            "text": "# FileCache (man)\n\n## NAME\n\nFileCache - keep more files open than the system permits\n\n## SYNOPSIS\n\nno strict 'refs';\nuse FileCache;\n# or\nuse FileCache maxopen => 16;\ncacheout $mode, $path;\n# or\ncacheout $path;\nprint $path @data;\n$fh = cacheout $mode, $path;\n# or\n$fh = cacheout $path;\nprint $fh @data;\n\n## DESCRIPTION\n\nThe \"cacheout\" function will make sure that there's a filehandle open for reading or writing\navailable as the pathname you give it. It automatically closes and re-opens files if you\nexceed your system's maximum number of file descriptors, or the suggested maximum maxopen.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CAVEATS**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "FileCache",
        "section": "",
        "mode": "man",
        "summary": "FileCache - keep more files open than the system permits",
        "synopsis": "no strict 'refs';\nuse FileCache;\n# or\nuse FileCache maxopen => 16;\ncacheout $mode, $path;\n# or\ncacheout $path;\nprint $path @data;\n$fh = cacheout $mode, $path;\n# or\n$fh = cacheout $path;\nprint $fh @data;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "FileCache - keep more files open than the system permits\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "no strict 'refs';\n\nuse FileCache;\n# or\nuse FileCache maxopen => 16;\n\ncacheout $mode, $path;\n# or\ncacheout $path;\nprint $path @data;\n\n$fh = cacheout $mode, $path;\n# or\n$fh = cacheout $path;\nprint $fh @data;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"cacheout\" function will make sure that there's a filehandle open for reading or writing\navailable as the pathname you give it. It automatically closes and re-opens files if you\nexceed your system's maximum number of file descriptors, or the suggested maximum maxopen.\n\ncacheout EXPR\nThe 1-argument form of cacheout will open a file for writing ('>') on it's first use, and\nappending ('>>') thereafter.\n\nReturns EXPR on success for convenience. You may neglect the return value and manipulate\nEXPR as the filehandle directly if you prefer.\n\ncacheout MODE, EXPR\nThe 2-argument form of cacheout will use the supplied mode for the initial and subsequent\nopenings. Most valid modes for 3-argument \"open\" are supported namely; '>', '+>', '<',\n'<+', '>>',  '|-'  and  '-|'\n\nTo pass supplemental arguments to a program opened with  '|-'  or  '-|' append them to\nthe command string as you would system EXPR.\n\nReturns EXPR on success for convenience. You may neglect the return value and manipulate\nEXPR as the filehandle directly if you prefer.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "While it is permissible to \"close\" a FileCache managed file, do not do so if you are calling\n\"FileCache::cacheout\" from a package other than which it was imported, or with another module\nwhich overrides \"close\".  If you must, use \"FileCache::cacheoutclose\".\n\nAlthough FileCache can be used with piped opens ('-|' or '|-') doing so is strongly\ndiscouraged.  If FileCache finds it necessary to close and then reopen a pipe, the command at\nthe far end of the pipe will be reexecuted - the results of performing IO on FileCache'd\npipes is unlikely to be what you expect.  The ability to use FileCache on pipes may be\nremoved in a future release.\n\nFileCache does not store the current file offset if it finds it necessary to close a file.\nWhen the file is reopened, the offset will be as specified by the original \"open\" file mode.\nThis could be construed to be a bug.\n\nThe module functionality relies on symbolic references, so things will break under 'use\nstrict' unless 'no strict \"refs\"' is also specified.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "sys/param.h lies with its \"NOFILE\" define on some systems, so you may have to set maxopen\nyourself.\n\n\n\nperl v5.34.0                                 2025-07-25                             FileCache(3perl)",
                "subsections": []
            }
        }
    }
}