⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file::glob.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.el .IP "\f(CWGLOB_ERR\fR" 4.IX Item "GLOB_ERR"Force \fIbsd_glob()\fR to return an error when it encounters a directory itcannot open or read.  Ordinarily \fIbsd_glob()\fR continues to find matches..ie n .IP """GLOB_LIMIT""" 4.el .IP "\f(CWGLOB_LIMIT\fR" 4.IX Item "GLOB_LIMIT"Make \fIbsd_glob()\fR return an error (\s-1GLOB_NOSPACE\s0) when the pattern expandsto a size bigger than the system constant \f(CW\*(C`ARG_MAX\*(C'\fR (usually found inlimits.h).  If your system does not define this constant, \fIbsd_glob()\fR uses\&\f(CW\*(C`sysconf(_SC_ARG_MAX)\*(C'\fR or \f(CW\*(C`_POSIX_ARG_MAX\*(C'\fR where available (in thatorder).  You can inspect these values using the standard \f(CW\*(C`POSIX\*(C'\fRextension..ie n .IP """GLOB_MARK""" 4.el .IP "\f(CWGLOB_MARK\fR" 4.IX Item "GLOB_MARK"Each pathname that is a directory that matches the pattern has a slashappended..ie n .IP """GLOB_NOCASE""" 4.el .IP "\f(CWGLOB_NOCASE\fR" 4.IX Item "GLOB_NOCASE"By default, file names are assumed to be case sensitive; this flagmakes \fIbsd_glob()\fR treat case differences as not significant..ie n .IP """GLOB_NOCHECK""" 4.el .IP "\f(CWGLOB_NOCHECK\fR" 4.IX Item "GLOB_NOCHECK"If the pattern does not match any pathname, then \fIbsd_glob()\fR returns a listconsisting of only the pattern.  If \f(CW\*(C`GLOB_QUOTE\*(C'\fR is set, its effectis present in the pattern returned..ie n .IP """GLOB_NOSORT""" 4.el .IP "\f(CWGLOB_NOSORT\fR" 4.IX Item "GLOB_NOSORT"By default, the pathnames are sorted in ascending \s-1ASCII\s0 order; thisflag prevents that sorting (speeding up \fIbsd_glob()\fR)..PPThe FreeBSD extensions to the \s-1POSIX\s0 standard are the following flags:.ie n .IP """GLOB_BRACE""" 4.el .IP "\f(CWGLOB_BRACE\fR" 4.IX Item "GLOB_BRACE"Pre-process the string to expand \f(CW\*(C`{pat,pat,...}\*(C'\fR strings like \fIcsh\fR\|(1).The pattern '{}' is left unexpanded for historical reasons (and \fIcsh\fR\|(1)does the same thing to ease typing of \fIfind\fR\|(1) patterns)..ie n .IP """GLOB_NOMAGIC""" 4.el .IP "\f(CWGLOB_NOMAGIC\fR" 4.IX Item "GLOB_NOMAGIC"Same as \f(CW\*(C`GLOB_NOCHECK\*(C'\fR but it only returns the pattern if it does notcontain any of the special characters \*(L"*\*(R", \*(L"?\*(R" or \*(L"[\*(R".  \f(CW\*(C`NOMAGIC\*(C'\fR isprovided to simplify implementing the historic \fIcsh\fR\|(1) globbingbehaviour and should probably not be used anywhere else..ie n .IP """GLOB_QUOTE""" 4.el .IP "\f(CWGLOB_QUOTE\fR" 4.IX Item "GLOB_QUOTE"Use the backslash ('\e') character for quoting: every occurrence of abackslash followed by a character in the pattern is replaced by thatcharacter, avoiding any special interpretation of the character.(But see below for exceptions on \s-1DOSISH\s0 systems)..ie n .IP """GLOB_TILDE""" 4.el .IP "\f(CWGLOB_TILDE\fR" 4.IX Item "GLOB_TILDE"Expand patterns that start with '~' to user name home directories..ie n .IP """GLOB_CSH""" 4.el .IP "\f(CWGLOB_CSH\fR" 4.IX Item "GLOB_CSH"For convenience, \f(CW\*(C`GLOB_CSH\*(C'\fR is a synonym for\&\f(CW\*(C`GLOB_BRACE | GLOB_NOMAGIC | GLOB_QUOTE | GLOB_TILDE | GLOB_ALPHASORT\*(C'\fR..PPThe \s-1POSIX\s0 provided \f(CW\*(C`GLOB_APPEND\*(C'\fR, \f(CW\*(C`GLOB_DOOFFS\*(C'\fR, and the FreeBSDextensions \f(CW\*(C`GLOB_ALTDIRFUNC\*(C'\fR, and \f(CW\*(C`GLOB_MAGCHAR\*(C'\fR flags have not beenimplemented in the Perl version because they involve more complexinteraction with the underlying C structures..PPThe following flag has been added in the Perl implementation forcsh compatibility:.ie n .IP """GLOB_ALPHASORT""" 4.el .IP "\f(CWGLOB_ALPHASORT\fR" 4.IX Item "GLOB_ALPHASORT"If \f(CW\*(C`GLOB_NOSORT\*(C'\fR is not in effect, sort filenames is alphabeticalorder (case does not matter) rather than in \s-1ASCII\s0 order..SH "DIAGNOSTICS".IX Header "DIAGNOSTICS"\&\fIbsd_glob()\fR returns a list of matching paths, possibly zero length.  If anerror occurred, &File::Glob::GLOB_ERROR will be non-zero and \f(CW$!\fR will beset.  &File::Glob::GLOB_ERROR is guaranteed to be zero if no error occurred,or one of the following values otherwise:.ie n .IP """GLOB_NOSPACE""" 4.el .IP "\f(CWGLOB_NOSPACE\fR" 4.IX Item "GLOB_NOSPACE"An attempt to allocate memory failed..ie n .IP """GLOB_ABEND""" 4.el .IP "\f(CWGLOB_ABEND\fR" 4.IX Item "GLOB_ABEND"The glob was stopped because an error was encountered..PPIn the case where \fIbsd_glob()\fR has found some matching paths, but isinterrupted by an error, it will return a list of filenames \fBand\fRset &File::Glob::ERROR..PPNote that \fIbsd_glob()\fR deviates from \s-1POSIX\s0 and FreeBSD \fIglob\fR\|(3) behaviourby not considering \f(CW\*(C`ENOENT\*(C'\fR and \f(CW\*(C`ENOTDIR\*(C'\fR as errors \- \fIbsd_glob()\fR willcontinue processing despite those errors, unless the \f(CW\*(C`GLOB_ERR\*(C'\fR flag isset..PPBe aware that all filenames returned from File::Glob are tainted..SH "NOTES".IX Header "NOTES".IP "\(bu" 4If you want to use multiple patterns, e.g. \f(CW\*(C`bsd_glob("a* b*")\*(C'\fR, you shouldprobably throw them in a set as in \f(CW\*(C`bsd_glob("{a*,b*}")\*(C'\fR.  This is becausethe argument to \fIbsd_glob()\fR isn't subjected to parsing by the C shell.Remember that you can use a backslash to escape things..IP "\(bu" 4On \s-1DOSISH\s0 systems, backslash is a valid directory separator character.In this case, use of backslash as a quoting character (via \s-1GLOB_QUOTE\s0)interferes with the use of backslash as a directory separator. Thebest (simplest, most portable) solution is to use forward slashes fordirectory separators, and backslashes for quoting. However, this doesnot match \*(L"normal practice\*(R" on these systems. As a concession to userexpectation, therefore, backslashes (under \s-1GLOB_QUOTE\s0) only quote theglob metacharacters '[', ']', '{', '}', '\-', '~', and backslash itself.All other backslashes are passed through unchanged..IP "\(bu" 4Win32 users should use the real slash.  If you really want to usebackslashes, consider using Sarathy's File::DosGlob, which comes withthe standard Perl distribution..IP "\(bu" 4Mac \s-1OS\s0 (Classic) users should note a few differences. SinceMac \s-1OS\s0 is not Unix, when the glob code encounters a tilde glob (e.g.~user) and the \f(CW\*(C`GLOB_TILDE\*(C'\fR flag is used, it simply returns thatpattern without doing any expansion..SpGlob on Mac \s-1OS\s0 is case-insensitive by default (if you don't use anyflags). If you specify any flags at all and still want globto be case-insensitive, you must include \f(CW\*(C`GLOB_NOCASE\*(C'\fR in the flags..SpThe path separator is ':' (aka colon), not '/' (aka slash). Mac \s-1OS\s0 usersshould be careful about specifying relative pathnames. While a full pathalways begins with a volume name, a relative pathname should alwaysbegin with a ':'.  If specifying a volume name only, a trailing ':' isrequired..SpThe specification of pathnames in glob patterns adheres to the usual Mac\&\s-1OS\s0 conventions: The path separator is a colon ':', not a slash '/'. Afull path always begins with a volume name. A relative pathname on Mac\&\s-1OS\s0 must always begin with a ':', except when specifying a file ordirectory name in the current working directory, where the leading colonis optional. If specifying a volume name only, a trailing ':' isrequired. Due to these rules, a glob like <*:> will find allmounted volumes, while a glob like <*> or <:*> will findall files and directories in the current directory..SpNote that updirs in the glob pattern are resolved before the matching begins,i.e. a pattern like \*(L"*HD:t?p::a*\*(R" will be matched as \*(L"*HD:a*\*(R". Note also,that a single trailing ':' in the pattern is ignored (unless it's a volumename pattern like \*(L"*HD:\*(R"), i.e. a glob like <:*:> will find bothdirectories \fIand\fR files (and not, as one might expect, only directories).You can, however, use the \f(CW\*(C`GLOB_MARK\*(C'\fR flag to distinguish (without a filetest) directory names from file names..SpIf the \f(CW\*(C`GLOB_MARK\*(C'\fR flag is set, all directory paths will have a ':' appended.Since a directory like 'lib:' is \fInot\fR a valid \fIrelative\fR path on Mac \s-1OS\s0,both a leading and a trailing colon will be added, when the directory name inquestion doesn't contain any colons (e.g. 'lib' becomes ':lib:')..SH "SEE ALSO".IX Header "SEE ALSO"\&\*(L"glob\*(R" in perlfunc, \fIglob\fR\|(3).SH "AUTHOR".IX Header "AUTHOR"The Perl interface was written by Nathan Torkington <gnat@frii.com>,and is released under the artistic license.  Further modifications weremade by Greg Bacon <gbacon@cs.uah.edu>, Gurusamy Sarathy<gsar@activestate.com>, and Thomas Wegner<wegner_thomas@yahoo.com>.  The C glob code has thefollowing copyright:.PP.Vb 2\&    Copyright (c) 1989, 1993 The Regents of the University of California.\&    All rights reserved.\&\&    This code is derived from software contributed to Berkeley by\&    Guido van Rossum.\&\&    Redistribution and use in source and binary forms, with or without\&    modification, are permitted provided that the following conditions\&    are met:\&\&    1. Redistributions of source code must retain the above copyright\&       notice, this list of conditions and the following disclaimer.\&    2. Redistributions in binary form must reproduce the above copyright\&       notice, this list of conditions and the following disclaimer in the\&       documentation and/or other materials provided with the distribution.\&    3. Neither the name of the University nor the names of its contributors\&       may be used to endorse or promote products derived from this software\&       without specific prior written permission.\&\&    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS \`\`AS IS\*(Aq\*(Aq AND\&    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\&    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\&    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\&    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\&    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\&    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\&    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\&    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\&    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\&    SUCH DAMAGE..Ve

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -