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

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

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

                                         Create a Tar Archive
                                         创建一个tar归档

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

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

Create a tar archive.
创建一个tar归档。


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


tar(tarfile, files = NULL,
    compression = c("none", "gzip", "bzip2", "xz"),
    compression_level = 6, tar = Sys.getenv("tar"),
    extra_flags = "")



参数----------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 writes.
tar文件的路径:波浪线扩展(见path.expand)将被执行。另外,可以使用二进制的连接写道。


参数:files
A character vector of filepaths to be archived: the default is to archive all files under the current directory.
要归档的一个特征向量的文件路径:默认是当前目录下的所有文件归档。


参数:compression
character string giving the type of compression to be used (default none).  Can be abbreviated.
字符串要使用的压缩类型(默认无)。可以缩写。


参数:compression_level
integer: the level of compression.  Only used for the internal method.
整数:压缩级别。仅用于内部方法。


参数: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还可以包含从命令由空格分隔的标志。


参数:extra_flags
any extra flags for an external tar.
外部tar任何额外的标志。


Details

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

This is either a wrapper for a tar command or uses an internal implementation in R.  The latter is used if tarfile is a connection or if the argument tar is "internal" or "".  Note that whereas Unix-alike versions of R set the environment variable TAR, its value is not the default for this function.
这是一个tar命令的包装或使用在R内部实施,后者用于如果tarfile是一个连接或如果参数tar是"internal" ""。请注意,而Unix相似的R版本的环境变量TAR,它的价值是没有此功能的默认设置。

Argument extra_flags is passed to an external tar and so is platform-dependent.  Possibly useful values include -h (follow symbolic links, also -L on some platforms), --acls, --exclude-backups, --exclude-vcs (and similar) and on Windows --force-local (so drives can be included in filepaths: this is the default for the Rtools tar.
参数extra_flags传递给外部tar是依赖于平台。可能有用的价值,包括-h(符号链接,也-L在某些平台上),--acls,--exclude-backups,--exclude-vcs(以及类似)和Windows --force-local(驱动器可以包含文件路径:这是默认的Rtoolstar。


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

The return code from system or 0 for the internal version, invisibly.
system或0内部版本,无形中返回代码。


可移植性----------Portability----------

The "tar" format no longer has an agreed standard! "Unix Standard Tar" was part of POSIX 1003.1:1998 but has been removed in favour of pax, and in any case many common implementations diverged from the former standard.  Most R platforms use a version of GNU tar (including Rtools on Windows, but the behaviour seems to be changed with each version), Mac OS 10.6 and FreeBSD use bsdttar from the libarchive   project, and commercial Unixes will have their own versions.
“焦油”格式不再有一个统一的标准! “UNIX标准焦油1003.1:1998的POSIX的一部分,但已被删除赞成pax,在任何情况下,有许多共同实现从原标准的分歧。大多数R平台上使用GNU版本的tar(Rtools在Windows,但行为似乎与每个版本的改变)的Mac OS 10.6和FreeBSD使用bsdttarlibarchive   project,商业Unix系统将有自己的版本。

Known problems arise from
已知的问题产生

The handling of file names of more than 100 bytes.  These were unsupported in early versions of tar, and supported in one way by POSIX tar and in another by GNU tar.  The internal implementation uses the POSIX way which supports up to 255 bytes (depending on the path), and warns on paths of more than 100 bytes.
处理超过100个字节的文件名。这些都是在早期版本的tar支持,并以某种方式支持的POSIXtar而在另一个由GNUtar。内部实现使用POSIX的方式,最多可支持255个字节(取决于路径),并警告超过100个字节的路径。

(File) links.  tar was developed on an OS that used hard links, and physical files that were referred to more than one in the list of files to be included were included only once, the remaining instance being added as links.  Later a means to include symbolic links was added.  The internal implementation supports symbolic links (on OSes that support them), only.  Of course, the question arises as to how links should be unpacked on OSes that do not support them: for files at least file copies can be used.
(文件)的链接。 tar开发的操作系统上使用硬链接和物理文件中提到的多个文件被列入名单的,只有一次被列入,其余的实例被添加为链接。后来增加了一种手段,包括符号链接。内部实现支持符号链接(支持它们的操作系统上),只。当然,问题是应如何链接不支持他们的操作系统上解开:至少可以使用的文件,文件副本。

Header fields, in particular the padding to be used when fields are not full or not used.  POSIX did define the correct behaviour but commonly used implementations did (and still do) not comply.
头领域,特别是要使用的领域时,是不完整或不使用填充。 POSIX的定义正确的行为,但常用的实现做了(仍然)不符合。

For portability, avoid file paths of more than 100 bytes, and links (or at least, hard links and symbolic links to directories).
为了可移植性,避免超过100个字节,并链接(或至少,硬链接和符号链接目录)的文件路径。

The internal implementation writes only the blocks of 512 bytes required, unlike GNU tar which by default pads with nul to a multiple of 20 blocks (10KB).  Implementations differ on whether the block padding should occur before or after compression
内部实施所需的512个字节的块写入,不同的GNUtar由nul20块(10KB)的倍数默认垫。实现不同块填充是否应该发生之前或之后,压缩


注意----------Note----------

Error reports from untar of the form
来自untar形式的错误报告


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

http://en.wikipedia.org/wiki/Tar_(file_format), http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 for the way the POSIX utility pax handles tar formats.
http://en.wikipedia.org/wiki/Tar_(file_format),http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06的POSIX实用程序pax处理方式tar格式。

http://code.google.com/p/libarchive/wiki/ManPageTar5.


untar.
untar。

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 16:31 , Processed in 0.024008 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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