Sys.glob(base)
Sys.glob()所属R语言包:base
Wildcard Expansion on File Paths
通配符扩展文件路径
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Function to do wildcard expansion (also known as "globbing") on file paths.
函数来执行文件路径通配符扩展(也称为“通配符”)。
用法----------Usage----------
Sys.glob(paths, dirmark = FALSE)
参数----------Arguments----------
参数:paths
character vector of patterns for relative or absolute filepaths. Missing values will be ignored.
相对或绝对的文件路径模式的特征向量。遗漏值将被忽略。
参数:dirmark
logical: should matches to directories from patterns that do not already end in / or \ have a slash appended? May not be supported on all platforms.
逻辑:应该从模式匹配的目录/或\斜线附加不已经结束?可能不支持所有平台上。
Details
详情----------Details----------
The glob system call is not part of Windows, and we supply a partial emulation.
glob系统调用是Windows的一部分,我们提供了部分仿真。
Wildcards are * (match zero or more characters) and ? (match a single character). If a filename starts with . this must be matched explicitly.
通配符*(匹配零个或多个字符)和?(匹配单个字符)。如果一个文件名以.开始明确必须匹配。
In addition, [ begins a character class. If the first character in [...] is not !, this is a character class which matches a single character against any of the characters specified. The class cannot be empty, so ] can be included provided it is first. If the first character is !, the character class matches a single character which is none of the specified characters.
此外,[开始一个字符类。如果在[...]的第一个字符不!,这是一个字符类匹配单个字符对指定的任何字符。类不能是空的,所以的]可以被列入提供的,它是第一。如果第一个字符是!,字符类匹配单个字符,这是没有指定的字符。
Character classes can include ranges such as [A-Z]: include - as a character by having it first or last in a class. (In the current implementation ranges are in numeric order of Unicode points.)
如[A-Z]字符类可以包括的范围:包括-作为一个有它的第一个或最后一类的字符。 (在目前的实施范围是数字顺序的Unicode点。)
One can remove the special meaning of ?, * and [ by preceding them by a backslash (except within a character class). Note that on Windows ? and * are not valid in file names, so this is mainly for consistency with other platforms.
一个可以去除特殊的意义,?*和[前面一个反斜杠(在字符类除外)。请注意,在Windows ?和*是不是有效文件名,所以这主要用于与其他平台的一致性。
File paths in Windows are interpreted with separator \ or /. Paths with a drive but relative (such as c:foo\bar) are tricky, but an attempt is made to handle them correctly. An attempt is made to handle UNC paths starting with a double backslash. UTF-8-encoded paths not valid in the current locale can be used.
Windows中的文件路径分隔\或/解释。驱动器,但相对路径(如c:foo\bar)是棘手的,但试图作出正确处理。尝试进行处理UNC路径用双反斜线开始。可以使用UTF-8编码的路径,在当前语言环境的有效。
值----------Value----------
A character vector of matched file paths. The order is system-specific (but in the order of the elements of paths): it is normally collated in either the current locale or in byte (ASCII) order; however, on Windows collation is in the order of Unicode points.
匹配的文件路径的一个特征向量。顺序是特定的系统(但在元素的顺序paths):它是在当前的区域设置或字节(ASCII)为了正常整理,但是,在Windows排序规则的Unicode的顺序是点。
Directory errors are normally ignored, so the matches are to accessible file paths (but not necessarily accessible files).
目录错误通常被忽略,因此比赛要访问的文件路径(但不一定是访问文件)。
参见----------See Also----------
path.expand.
path.expand。
Quotes for handling backslashes in character strings.
引号处理字符串中的反斜杠。
举例----------Examples----------
## Not run: [#无法运行:]
Sys.glob(file.path(R.home(), "library", "*", "R", "*.rdx"))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|