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

📄 file.fix

📁 由3926个源代码
💻 FIX
字号:
          Making the "file" command recognize zoo archives

Zoo archives have the following magic number:  Beginning at offset 20
decimal, there are four bytes with the values 0xdc, 0xa7, 0xc4, and
0xfd.  (But if you call the first byte of a zoo archive byte 1, then
the magic bytes will be bytes 21 through 24.)

To make the "file" command identify zoo archives, changes can be made
as follows.

4.3BSD:  See the context diff near the end of this document, suitable
for application with the "patch" utility, that works with the 4.3BSD 
"file" command on a VAX-11/785.  I don't know if this will also work 
under 4.2BSD or with any other implementation of the "file" command 
or on any other CPU.

System V Release 2 (as exemplified by Microport System V/AT):  At the
end of the file "/etc/magic", add the following line:

20	long		0xfdc4a7dc	zoo archive

This should work on a little-endian machine, in which the long value
0xfdc4a7dc is stored with the least-significant byte first.  For a big-
endian machine, you will probably need to replace it with 0xdca7c4fd.
This assumes that long occupies 4 bytes.  If not, use a data type name
that is exactly 4 bytes.

=====
Changes needed to make the 4.3BSD "file" command recognize zoo
archives.  Known to work on a VAX-11/785.

*** file.c.old	Thu Mar  6 19:34:29 1986
--- file.c	Sat Feb 21 19:28:52 1987
***************
*** 172,181 ****
--- 172,187 ----
  	case 070707:
  		printf("cpio data\n");
  		return;
  	}
  
+ 	if (buf[20] == (char) 0xdc && buf[21] == (char) 0xa7 && 
+             		buf[22] == (char) 0xc4 && buf[23] == (char) 0xfd) {
+ 		printf ("zoo archive\n");
+ 		return;
+ 	}
+ 
  	if (buf[0] == '#' && buf[1] == '!' && shellscript(buf+2, &mbuf))
  		return;
  	if (buf[0] == '\037' && buf[1] == '\235') {
  		if (buf[2]&0x80)
  			printf("block ");

⌨️ 快捷键说明

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