找回密码
 注册
查看: 2685|回复: 0

R语言:untar()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:53:00 | 显示全部楼层 |阅读模式
untar(utils)
untar()所属R语言包:utils

                                         Extract or List Tar Archives
                                         提取或列出tar归档

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Extract files from or list a tar archive.
提取文件或列出一个tar归档。


用法----------Usage----------


untar(tarfile, files = NULL, list = FALSE, exdir = ".",
      compressed = NA, extras = NULL, verbose = FALSE,
      tar = Sys.getenv("TAR"))



参数----------Arguments----------

参数:tarfile
The pathname of the tar file: tilde expansion (see path.expand) will be performed.  Alternatively, a connection that can be used for binary reads.
tar文件的路径:波浪线扩展(见path.expand)将被执行。另外,可以使用二进制的连接读取。


参数:files
A character vector of recorded filepaths to be extracted: the default is to extract all files.
特征向量的记录要提取的文件路径:默认是提取所有文件。


参数:list
If TRUE, just list the files.  The equivalent of tar -tf.  Otherwise extract the files (the equivalent of tar -xf).
如果TRUE,只列出的文件。相当于的tar -tf的。否则,提取的文件(相当于tar -xf的)。


参数:exdir
The directory to extract files to (the equivalent of tar -C).  It will be created if necessary.
提取文件目录(相当于tar -C的)。如有必要,将创建它。


参数:compressed
logical or character.  Values "gzip", "bzip2" and "xz" select that form of compression (and may be abbreviated to the first letter).  TRUE indicates gzip compression, FALSE no known compression (but the tar command may detect compression automagically), and NA (the default) that the type is inferred from the file header.
逻辑或字符。值"gzip","bzip2"和"xz"选择,压缩形式(可能是缩写的第一个字母)。 TRUE表示gzip压缩,FALSE(但没有已知的压缩tar命令可以自动地检测压缩),NA(默认),从文件类型推断头。


参数:extras
NULL or a character string: further command-line flags such as -p to be passed to the tar program.
NULL或一个字符串:进一步的命令行标志,如-p要传递给tar方案。


参数:verbose
logical: if true echo the command used.
逻辑:如果真正的回声命令。


参数:tar
character string: the path to the command to be used.  If the command itself contains spaces it needs to be quoted – but tar can also contain flags separated from the command by spaces.
字符串:要使用的命令的路径。如果该命令本身包含空格,它需要被引用 - 但tar还可以包含从命令由空格分隔的标志。


Details

详情----------Details----------

This is either a wrapper for a tar command or for an internal implementation written in R.  The latter is used if tarfile is a connection or if the argument tar is "internal" or "" (except on Windows, when tar.exe is tried first).
这是一个tar命令或写在R内部实施的包装,后者用于tarfile是一个连接或如果参数tar是"internal"或""(Windows上,当tar.exe第一次尝试除外)。

What options are supported will depend on the tar used. Modern GNU flavours of tar will support compressed archives, and since 1.15 are able to detect the type of compression automatically: version 1.20 added support for lzma and version 1.22 for xz compression using LZMA2.  For other flavours of tar, environment variable R_GZIPCMD gives the command to decompress gzip and compress files, and R_BZIPCMD for its files.  (There is a bsdtar command from the libarchive project used by Mac OS 10.6 ("Snow Leopard") which can also detect gzip and bzip2 compression automatically, as can the tar from the "Heirloom Toolchest" project.)
选项支持将取决于tar使用。现代的GNUtar口味支持压缩档案,因为1.15是能够自动检测的压缩类型:1.20版本增加了对lzma和使用xz压缩LZMA2的1.22版本的支持。对于其他口味的tar,环境变量R_GZIPCMD给的命令解压缩gzip和compress文件,R_BZIPCMD文件。 (有bsdtar命令libarchive项目由Mac OS 10.6(雪豹)使用,也可以检测gzip和bzip2自动压缩,可以tar从“传家宝工具箱”项目“。)

Arguments compressed, extras and verbose are only used when an external tar is used.
参数compressed,extras和verbose时只使用一个外部的tar用于。

The internal implementation restores symbolic links as links on a Unix-alike, and as file copies on Windows (which works only for existing files, not for directories), and hard links as links.  If the linking operation fails (as it may on a FAT file system), a file copy is tried.  Since it uses gzfile to read a file it can handle files compressed by any of the methods that function can handle: at least compress, gzip, bzip2 and xz compression, and some types of lzma compression.  It does not guard against restoring absolute file paths, as some tar implementations do.  It will create the parent directories for directories or files in the archive if necessary.  It handles both the standard (USTAR/POSIX) and GNU ways of handling file paths of more than 100 bytes.
内部实现恢复符号链接作为链接Unix的一致好评,并在Windows(只适用于现有的文件,不是目录,),硬链接的链接文件副本。如果连接操作失败(因为它可能在FAT文件系统),文件的副本尝试。由于它使用gzfile读取一个文件,它可以处理任何功能可以处理的方法,压缩文件:至少compress,gzip,bzip2和<X >压缩和一些类型xz压缩。它并不防止恢复绝对路径,一些lzma实现。如有必要,它将创建归档目录或文件的父目录。它可以处理标准(USTAR / POSIX)和GNU方式处理超过100个字节的文件路径。

You may see warnings from the internal implementation such as
从内部实现,如您可能会看到警告


值----------Value----------

If list = TRUE, a character vector of (relative or absolute) paths of files contained in the tar archive.
如果list = TRUE,特征向量在tar归档文件中包含的文件的路径(相对或绝对)。

Otherwise the return code from system, invisibly.
否则从system,无形的返回代码。


参见----------See Also----------

tar, unzip.  
tar,unzip。

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-25 03:58 , Processed in 0.023125 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表