Unlock instant, AI-driven research and patent intelligence for your innovation.

A cpio file operation method and device

A file, sub-file technology

Active Publication Date: 2018-09-25
ACTIONS ZHUHAI TECH CO
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] Because the file attribute in the cpio format is 4 bytes, the file attribute of the FAT32 (File Allocation Table) file system is only 2 bytes; if it is scattered to the disk in the FAT32 format, the attribute will be lost, and the CPIO file created will be reloaded to the portable Various access rights issues can occur on electronic devices
[0010] The temporary directory of cpio.exe that comes with cygwin is generally under the system disk, so the local folder is also in the system disk. If the system disk is not in NTFS format, cpio.exe cannot be used normally.
[0011] 2) Disperse and recreate this process for the entire CPIO file. If only one of the files is modified, the entire CPIO file needs to be dispersed. After modifying one of the files, the CPIO integration file must be re-made. It is inefficient to edit one of the CPIO files separately without distributing the CPIO files
[0012] 3) The corresponding dynamic library DLL of cygwin must be included when cpio.exe is deployed and released

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A cpio file operation method and device
  • A cpio file operation method and device
  • A cpio file operation method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0101] This embodiment provides how to operate the CPIO file when a read operation instruction is received.

[0102] Import CPIO files including multiple sub-files;

[0103] Traverse the CPIO file including multiple sub-files according to the parsing method of the binary file, identify and record the file header of each sub-file and the absolute offset of the sub-file relative to the starting position of the CPIO file, the file header includes the file name of the sub-file and file size;

[0104] Create an entry index table including multiple entries in the memory in the order of the subfiles, where each entry includes a file header and an absolute offset of a subfile;

[0105] When a read operation instruction is received, according to the file name of the sub-file to be read, check whether there is an entry containing the file name in the entry index table;

[0106] If it exists, return True; otherwise return False, after returning True, locate the subfile position to be r...

Embodiment 2

[0110] This embodiment provides how to operate the CPIO file when a renaming operation instruction is received.

[0111] Import CPIO files including multiple sub-files;

[0112] Traverse the CPIO file including multiple sub-files according to the parsing method of the binary file, identify and record the file header of each sub-file and the absolute offset of the sub-file relative to the starting position of the CPIO file, the file header includes the file name of the sub-file and file size;

[0113] Create an entry index table including multiple entries in the memory in the order of the subfiles, where each entry includes a file header and an absolute offset of a subfile;

[0114] When a renaming operation command is received, check whether there is a subfile to be renamed in the header;

[0115] If it exists, return True; otherwise return False, and return True to determine whether the length of the file name will change after renaming;

[0116] If the length of the file ...

Embodiment 3

[0120] This embodiment provides how to operate a CPIO file when an editing operation instruction on the file content is received.

[0121] Import CPIO files including multiple sub-files;

[0122] Traverse the CPIO file including multiple sub-files according to the parsing method of the binary file, identify and record the file header of each sub-file and the absolute offset of the sub-file relative to the starting position of the CPIO file, the file header includes the file name of the sub-file and file size;

[0123] Create an entry index table including multiple entries in the memory in the order of the subfiles, where each entry includes a file header and an absolute offset of a subfile;

[0124] When receiving an editing operation instruction on the content of the file, check whether there is a sub-file to be modified in the header;

[0125] If it exists, return True; otherwise return False, and return True to determine whether the length of the file content has changed ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides an operation method of a CPIO file and an operation device of the CPIO file. The method comprises the following steps of: traversing the CPIO file comprising a plurality of sub files in a binary file resolving mode; recognizing and recording a file header of each sub file and the absolute deviation of each sub file relative to the starting position of the CPIO file, wherein each file head comprises a file name and the file size of each sub file; creating an item index table comprising a plurality of items in a memory according to the sequence of the sub files wherein each item comprises the file header of one sub file and the absolute deviation; locating the position of the sub file to be operated according to the item index table in the memory when an operation instrument is received in each time; operating the sub file in the corresponding position; and updating the item index table in the memory when the condition that the items are changed after the operation is determined. The method and the device can achieve the goal of fast reading and writing a CPIO format file in a nondestructive way on a Windows platform.

Description

technical field [0001] The invention relates to the technical field of computer files, in particular to a method and device for operating CPIO files. Background technique [0002] The CPIO file format is the file format of the UNIX operating system. CPIO file is essentially a collection of files, including multiple sub-files, each sub-file includes file header and file content, contains a series of file information and content, such as file name, absolute path, timestamp, device type and version, user group And access rights, file version, file size, file content, etc. Use the cpio program on Linux to operate CPIO files, including access, creation, reading and writing, etc. [0003] CPIO files are currently loaded on portable electronic devices using the Android system, such as tablets. During the development process, it is necessary to download CPIO files from portable electronic devices through corresponding interfaces, modify the downloaded CPIO files and then load the...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F17/30
Inventor 蔡海群李国斌杨敏
Owner ACTIONS ZHUHAI TECH CO