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

📄 tar.5

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 5
字号:
.\" SCCSID: @(#)tar.5	8.1	9/11/90.TH tar 5 .SH Nametar, mdtar \- tape archive file format.SH Description.NXR "tar file" "format".NXR "mdtar file" "format"The tape archive command .PN tar dumps several files, including special files,into one,in a medium suitable for transportation..PPA.PN tartape or file is a series of blocks.Each block is of size TBLOCK.A file on the tape is represented by a header block,which describes the file,followed by zero or more blocks,which give the contents of the file.At the end of the tape are two blocks filled with binary zeros,as an end-of-file indicator.  .PPThe blocks are grouped for physical I/O operations.Each group of.I nblocks (where.I nis set by the .PN boption on the .MS tar 1command line, and the default is 20 blocks)is written with a single systemcall;on 9-track tapes,the result of this write is a single tape record.The last group is always written at the full size,so blocks after the two zero blocks contain random data.On reading,the specified or default group size is used for the first read,but if that read returns less than a full tape block,the reduced block size is used for further reads..PPThe following is an example of a header block:.NXR(e) "tar file" "header block".EX#define TBLOCK  512#define NAMSIZ  100union hblock {        char dummy[TBLOCK];        struct header {                char name[NAMSIZ];                char mode[8];                char uid[8];                char gid[8];                char size[12];                char mtime[12];                char chksum[8];                char linkflag;                char linkname[NAMSIZ];                char rdev[6]        } dbuf;};.EE.PPThe.I namefield is a null-terminated string.The other fields are 0-filled octal numbers in ASCII.Each field (of width \fIw\fR) contains \fIw\fR minus 2digits,a space, and a null, except.I sizeand.I mtime ,which do not contain the trailing null.The.I namefield specifies the name of the file,as specified on the .PN tarcommand line.Files dumped because they were in a directory thatwas named in the command line have the directory name as prefix and.I \fH/\fIfilenameas suffix..\" Whatever format was used in the command line.\" will appear here, such as.\" .I \&./yellow.\" or.\" .IR \&../../brick/./road/.. ..\" To retrieve a file from a tar tape, an exact prefix match must be specified,.\" including all of the directory prefix information used on the command line.\" that dumped the file (if any).The.PN modefield specifies the file mode,with the top bit masked off.The.I uidand.I gidfields specify the user and group numbers that own the file.The.I sizefield specifies the size of the file in bytes.Links and symbolic links are dumpedwith this field specified as zero.The.I mtimefield specifies the modification time of the fileat the time it was dumped.The.I chksumfield is a decimal ASCII value,which represents the sum of all the bytes in the header block.When calculating the checksum,the .I chksumfield is treated as if it were all blanks.The.I linkflagfield is ASCII 0 if the file is normal or a special fileand ASCII 1 if it is a hard link,and ASCII 2 if it is a symbolic link.The name to which it is linked,if any, is in.I linkname,with a trailing null.Unused fields of the header are binary zeros and are included in thechecksum.The.I rdevfield encodes the ASCII representation of a device special file'smajor and minor device numbers..PPThe first time a given i-node number is dumped,it is dumped as a regular file.The second and subsequent times,it is dumped as a link instead.Upon retrieval,if a link entry is retrieved,but not the file it was linked to,an error message is printed and the tape must be manuallyrescanned to retrieve the linked file..PPThe encoding of the header is designed to be portable across machines..SH Restrictions.NXR "tar file" "restricted"Names or link names longer than NAMSIZproduce error reports and cannot be dumped..SH See Alsotar(1)

⌨️ 快捷键说明

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