|
��������
cpio - ������ ������ cpio
��������
���� ��� ������� cpio(1) �� ������������ ����� -c, ��
��������� ����� ����� ��������� ���������:
struct { short h_magic, h_dev; ushort h_ino, h_mode, h_uid, h_gid; short h_nlink, h_rdev, h_mtime [2], h_namesize, h_filesize [2]; char h_name [h_namesize ����������� �� �����]; } Hdr;���� ����� -c ������������, �� ��������� ����� ����������� ��������� �������:
sscanf(Chdr,"%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s", &Hdr.h_magic, &Hdr.h_dev, &Hdr.h_ino, &Hdr.h_mode, &Hdr.h_uid, &Hdr.h_gid, &Hdr.h_nlink, &Hdr.h_rdev, &Longtime, &Hdr.h_namesize,&Longfile,Hdr.h_name);
Longtime � Longfile ������������ ����� Hdr.h_mtime � Hdr.h_filesize ��������������. ���������� ������� ����� ������ � ������� ����������, ������������ ����, ���������� � ������� ������� �������� ���������� �����. ������ ��������� h_magic �������� ������������ ��������� 070707. ���� �� h_dev �� h_mtime ����� ��� �� �����, ��� � ����������� �������� stat(2). ����� ���������������� ����� ����������� ����� h_name, ������� � ������� ����, �������� � h_namesize.
������ ���������� �������� ������ ������ ������ TRAILER!!!. ����������� �����, �������� � ��������� ������� ������ ����������� � ����� h_filesize, ������ ����.
��. �����
stat(2).
cpio(1), find(1) � ����������� ������������.
|