{
    "content": [
        {
            "type": "text",
            "text": "# RWARRAY (man)\n\n## NAME\n\nwritea, reada, writeall, readall - write and read gawk arrays to/from files\n\n## SYNOPSIS\n\n@load \"rwarray\"\nret = writea(file, array)\nret = reada(file, array)\nret = writeall(file)\nret = readall(file)\n\n## DESCRIPTION\n\nThe  rwarray  extension adds functions named writea(), reada(), writeall(), and readall(), as\nfollows.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **NOTES**\n- **EXAMPLE**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYING PERMISSIONS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "RWARRAY",
        "section": "",
        "mode": "man",
        "summary": "writea, reada, writeall, readall - write and read gawk arrays to/from files",
        "synopsis": "@load \"rwarray\"\nret = writea(file, array)\nret = reada(file, array)\nret = writeall(file)\nret = readall(file)",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "@load \"rwarray\"",
            "...",
            "ret = writea(\"arraydump.bin\", array)",
            "...",
            "ret = reada(\"arraydump.bin\", array)",
            "...",
            "ret = writeall(\"globalstate.bin\")",
            "...",
            "ret = readall(\"globalstate.bin\")"
        ],
        "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": "chr",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/chr/3am/json"
            },
            {
                "name": "readdir",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/readdir/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": "time",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/time/3am/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "writea()",
                        "lines": 4
                    },
                    {
                        "name": "reada()",
                        "lines": 4
                    },
                    {
                        "name": "writeall()",
                        "lines": 5
                    },
                    {
                        "name": "readall()",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYING PERMISSIONS",
                "lines": 14,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "writea, reada, writeall, readall - write and read gawk arrays to/from files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "@load \"rwarray\"\n\nret = writea(file, array)\nret = reada(file, array)\nret = writeall(file)\nret = readall(file)\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  rwarray  extension adds functions named writea(), reada(), writeall(), and readall(), as\nfollows.\n",
                "subsections": [
                    {
                        "name": "writea()",
                        "content": "This function takes a string argument, which is the name of the file to which dump the\narray, and the array itself as the second argument.  writea() understands  multidimen‐\nsional arrays.  It returns one on success, or zero upon failure.\n"
                    },
                    {
                        "name": "reada()",
                        "content": "is  the inverse of writea(); it reads the file named as its first argument, filling in\nthe array named as the second argument. It clears the array first.  Here too, the  re‐\nturn value is one on success and zero upon failure.\n"
                    },
                    {
                        "name": "writeall()",
                        "content": "This function takes a string argument, which is the name of the file to which dump the\nstate  of  all  variables.  Calling  this function is completely equivalent to calling\nwritea() with the second argument equal to SYMTAB.  It returns one on success, or zero\nupon failure.\n"
                    },
                    {
                        "name": "readall()",
                        "content": "This function takes a string argument, which is the name of the  file  from  which  to\nread  the  contents  of  various global variables.  For each variable in the file, the\ndata is loaded unless the variable already exists. If the variable already exists, the\ndata for that variable in the file is ignored.  It returns one  on  success,  or  zero\nupon failure.\n"
                    }
                ]
            },
            "NOTES": {
                "content": "The  array  created by reada() is identical to that written by writea() in the sense that the\ncontents are the same. However, due to implementation issues, the array  traversal  order  of\nthe  recreated array will likely be different from that of the original array.  As array tra‐\nversal order in AWK is by default undefined, this is not (technically)  a  problem.   If  you\nneed  to guarantee a particular traversal order, use the array sorting features in gawk to do\nso.\n\nThe file contains binary data.  All integral values are written in network byte order.   How‐\never, double precision floating-point values are written as native binary data.  Thus, arrays\ncontaining  only  string  data can theoretically be dumped on systems with one byte order and\nrestored on systems with a different one, but this has not been tried.\n",
                "subsections": []
            },
            "EXAMPLE": {
                "content": "@load \"rwarray\"\n...\nret = writea(\"arraydump.bin\", array)\n...\nret = reada(\"arraydump.bin\", array)\n...\nret = writeall(\"globalstate.bin\")\n...\nret = readall(\"globalstate.bin\")\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "GAWK: Effective AWK Programming, filefuncs(3am), fnmatch(3am), fork(3am), inplace(3am),  ord‐\nchr(3am), readdir(3am), readfile(3am), revoutput(3am), time(3am).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Arnold Robbins, arnold@skeeve.com.\n",
                "subsections": []
            },
            "COPYING PERMISSIONS": {
                "content": "Copyright © 2012, 2013, 2018, 2022 Free Software Foundation, Inc.\n\nPermission is granted to make and distribute verbatim copies of this manual page provided the\ncopyright notice and this permission notice are preserved on all copies.\n\nPermission  is granted to copy and distribute modified versions of this manual page under the\nconditions for verbatim copying, provided that the entire resulting derived work is  distrib‐\nuted under the terms of a permission notice identical to this one.\n\nPermission  is  granted  to copy and distribute translations of this manual page into another\nlanguage, under the above conditions for modified versions, except that this  permission  no‐\ntice may be stated in a translation approved by the Foundation.\n\nFree Software Foundation                     Mar 11 2022                                RWARRAY(3am)",
                "subsections": []
            }
        }
    }
}