{
    "content": [
        {
            "type": "text",
            "text": "# File::Spec::Unix (perldoc)\n\n## NAME\n\nFile::Spec::Unix - File::Spec for Unix, base for other File::Spec modules\n\n## SYNOPSIS\n\nrequire File::Spec::Unix; # Done automatically by File::Spec\n\n## DESCRIPTION\n\nMethods for manipulating file specifications. Other File::Spec modules, such as File::Spec::Mac,\ninherit from File::Spec::Unix and override specific methods.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (4 subsections)\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "File::Spec::Unix",
        "section": "",
        "mode": "perldoc",
        "summary": "File::Spec::Unix - File::Spec for Unix, base for other File::Spec modules",
        "synopsis": "require File::Spec::Unix; # Done automatically by File::Spec",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "canonpath",
                        "lines": 10
                    },
                    {
                        "name": "catdir",
                        "lines": 86
                    },
                    {
                        "name": "catpath",
                        "lines": 27
                    },
                    {
                        "name": "rel2abs",
                        "lines": 18
                    }
                ]
            },
            {
                "name": "COPYRIGHT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "File::Spec::Unix - File::Spec for Unix, base for other File::Spec modules\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "require File::Spec::Unix; # Done automatically by File::Spec\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Methods for manipulating file specifications. Other File::Spec modules, such as File::Spec::Mac,\ninherit from File::Spec::Unix and override specific methods.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "canonpath",
                        "content": "No physical check on the filesystem, but a logical cleanup of a path. On UNIX eliminates\nsuccessive slashes and successive \"/.\".\n\n$cpath = File::Spec->canonpath( $path ) ;\n\nNote that this does *not* collapse x/../y sections into y. This is by design. If /foo on your\nsystem is a symlink to /bar/baz, then /foo/../quux is actually /bar/quux, not /quux as a naive\n../-removal would give you. If you want to do this kind of processing, you probably want\n\"Cwd\"'s \"realpath()\" function to actually traverse the filesystem cleaning up paths like this.\n"
                    },
                    {
                        "name": "catdir",
                        "content": "Concatenate two or more directory names to form a complete path ending with a directory. But\nremove the trailing slash from the resulting string, because it doesn't look good, isn't\nnecessary and confuses OS2. Of course, if this is the root directory, don't cut off the\ntrailing slash :-)\n\ncatfile\nConcatenate one or more directory names and a filename to form a complete path ending with a\nfilename\n\ncurdir\nReturns a string representation of the current directory. \".\" on UNIX.\n\ndevnull\nReturns a string representation of the null device. \"/dev/null\" on UNIX.\n\nrootdir\nReturns a string representation of the root directory. \"/\" on UNIX.\n\ntmpdir\nReturns a string representation of the first writable directory from the following list or the\ncurrent directory if none from the list are writable:\n\n$ENV{TMPDIR}\n/tmp\n\nIf running under taint mode, and if $ENV{TMPDIR} is tainted, it is not used.\n\nupdir\nReturns a string representation of the parent directory. \"..\" on UNIX.\n\nnoupwards\nGiven a list of file names, strip out those that refer to a parent directory. (Does not strip\nsymlinks, only '.', '..', and equivalents.)\n\ncasetolerant\nReturns a true or false value indicating, respectively, that alphabetic is not or is\nsignificant when comparing file specifications.\n\nfilenameisabsolute\nTakes as argument a path and returns true if it is an absolute path.\n\nThis does not consult the local filesystem on Unix, Win32, OS/2 or Mac OS (Classic). It does\nconsult the working environment for VMS (see \"filenameisabsolute\" in File::Spec::VMS).\n\npath\nTakes no argument, returns the environment variable PATH as an array.\n\njoin\njoin is the same as catfile.\n\nsplitpath\n($volume,$directories,$file) = File::Spec->splitpath( $path );\n($volume,$directories,$file) = File::Spec->splitpath( $path,\n$nofile );\n\nSplits a path into volume, directory, and filename portions. On systems with no concept of\nvolume, returns '' for volume.\n\nFor systems with no syntax differentiating filenames from directories, assumes that the last\nfile is a path unless $nofile is true or a trailing separator or /. or /.. is present. On\nUnix this means that $nofile true makes this return ( '', $path, '' ).\n\nThe directory portion may or may not be returned with a trailing '/'.\n\nThe results can be passed to \"catpath()\" to get back a path equivalent to (usually identical\nto) the original path.\n\nsplitdir\nThe opposite of \"catdir()\".\n\n@dirs = File::Spec->splitdir( $directories );\n\n$directories must be only the directory portion of the path on systems that have the concept\nof a volume or that have path syntax that differentiates files from directories.\n\nUnlike just splitting the directories on the separator, empty directory names ('') can be\nreturned, because these are significant on some OSs.\n\nOn Unix,\n\nFile::Spec->splitdir( \"/a/b//c/\" );\n\nYields:\n\n( '', 'a', 'b', '', 'c', '' )\n"
                    },
                    {
                        "name": "catpath",
                        "content": "Takes volume, directory and file portions and returns an entire path. Under Unix, $volume is\nignored, and directory and file are concatenated. A '/' is inserted if needed (though if the\ndirectory portion doesn't start with '/' it is not added). On other OSs, $volume is\nsignificant.\n\nabs2rel\nTakes a destination path and an optional base path returns a relative path from the base path\nto the destination path:\n\n$relpath = File::Spec->abs2rel( $path ) ;\n$relpath = File::Spec->abs2rel( $path, $base ) ;\n\nIf $base is not present or '', then cwd() is used. If $base is relative, then it is converted\nto absolute form using \"rel2abs()\". This means that it is taken to be relative to cwd().\n\nOn systems that have a grammar that indicates filenames, this ignores the $base filename.\nOtherwise all path components are assumed to be directories.\n\nIf $path is relative, it is converted to absolute form using \"rel2abs()\". This means that it\nis taken to be relative to cwd().\n\nNo checks against the filesystem are made, so the result may not be correct if $base contains\nsymbolic links. (Apply Cwd::abspath() beforehand if that is a concern.) On VMS, there is\ninteraction with the working environment, as logicals and macros are expanded.\n\nBased on code written by Shigio Yamaguchi.\n"
                    },
                    {
                        "name": "rel2abs",
                        "content": "Converts a relative path to an absolute path.\n\n$abspath = File::Spec->rel2abs( $path ) ;\n$abspath = File::Spec->rel2abs( $path, $base ) ;\n\nIf $base is not present or '', then cwd() is used. If $base is relative, then it is converted\nto absolute form using \"rel2abs()\". This means that it is taken to be relative to cwd().\n\nOn systems that have a grammar that indicates filenames, this ignores the $base filename.\nOtherwise all path components are assumed to be directories.\n\nIf $path is absolute, it is cleaned up and returned using \"canonpath()\".\n\nNo checks against the filesystem are made. On VMS, there is interaction with the working\nenvironment, as logicals and macros are expanded.\n\nBased on code written by Shigio Yamaguchi.\n"
                    }
                ]
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nPlease submit bug reports and patches to perlbug@perl.org.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "File::Spec\n",
                "subsections": []
            }
        }
    }
}