Document Management 1

Chapter VII Document Management

 

 6.1 Files and file systems

1. File record data items

1. Data items

In the file system, data items are the lowest level of data organization, which can be divided into the following two types:

(1)  the basic data item, which is used to describe a character set of an attribute of the object, the data organization can command the smallest unit of logical data name, also called the field. For example, the basic data items used to describe a student are: student number, name, age, class, etc.

(2)  Combined data items. It is composed of several basic data items, referred to as group items. For example, salary is a group item, which can be composed of basic items such as basic salary, seniority 1. capital and reward salary.

Data item description attributes (columns)

  1. recording

Tuple (row)

A record is a collection of related data items used to describe the properties of an object in a certain aspect.

In many records, in order to uniquely identify a record ( one or more data items ) , one or several data items must be identified in each data item of a record , and their collection is called a key. . In other words, the keyword is the only data item that can identify a record. Usually, only one data item is used as a keyword.

  1. file

A file is a set of related information with a file name.

File attributes include: file type, file length, physical location of the file, and file creation time.

Second, the file type

1)  Classification by use 

According to the nature and use of documents, documents can be divided into three categories:

(1)  System files, which refer to files composed of system software. Most system files are only allowed to be called by the user, but they are not allowed to be read or modified: some system files are not directly open to users.

(2)  User files refer to files composed of the user's source code, object files, executable files or data. The user entrusts these files to the system for safekeeping.

(3) Library file, which is a file composed of standard subroutines and commonly used routines. These files allow the user to tune with, but not modify.

2)  Classification according to the form of data in the file

In this way of classification, files can also be divided into three categories:

(1) Source file, which refers to a file composed of source programs and data. Typically, the source terminal of the input device or input file programs and data are all formed by the source file. It is usually composed of ASCII codes or Chinese characters.

(2)  the target file, which means the source code compiled program compiled, the DA has not been linked linker purpose file consisting of standard code. Head extension standard used in the document is ".obj".

(3)  an executable file, which means that the text object code generated by the compiler program chain link after the formed member. Its suffix is .exe

3)  Classified by access control attributes

The access control as provided in the system administrator or user of, the file can be divided into three categories:

(1)  Only execute files, such files are only allowed to be called and executed by authorized users, and read and write are not allowed.

(2)  Read-only files. Files of this type are only allowed to be read by the file owner and approved users, but not written.

(3)  Read and write files, which refers to files that allow the file owner and authorized users to read or write.

4)  Classification by organization form and processing method

Depending on the organization of the file and how the system handles it, the file can be divided into three categories:

(1)  Ordinary files are character files composed of ASCII codes or binary codes. The source program files, data files, code files, and utility programs created by ordinary users are ordinary files.

(2) The directory file is a file composed of a file directory, and the information of its subordinate files can be retrieved through the directory file, and the operation of the executable file is the same as the ordinary file.

(3) Special files refer to various I / O devices in the system. In order to facilitate unified management, the system treats all I / O devices as files and provides them for users to use in a file manner, such as directory retrieval and permission verification are similar to ordinary files, but the operation of these files will be performed by the device Driver to complete.

Third, the file system

File system interface

Software collection for object manipulation and management

Description of files, objects and their attributes

 

Four, file operations

  1. The most basic file operations The most basic file operations include the following: 

(1)  Create a file. When you create a new file, you want to assign a new file the necessary external memory space, file and project whom the establishment of a directory entry in the record; catalog entry should record the file name of the new file attributes such as their addresses in external memory.

(2)  Delete the file. When deleting, you should first find the directory item of the file to be deleted from the directory to make it an empty item, and then reclaim the storage space occupied by the file.

(3)  Read documents. When reading a file, search the directory according to the file name given by the user, and get the location of the read file in the external storage from it: in the directory entry, there is also a pointer for reading / writing the file .

(4)  Write a file. When writing a file, find the file name directory, find the directory entry specified file, re-use project write pointer recorded in writing.

(5) Set the file read / write location. The front surface of said file read / write operations, only provides means for sequential access file, i.e., each time a read or write from the beginning of the file; setting file read / write position of the operation, by setting the file read / Write pointer bit, so that when reading / writing a file, it no longer starts from its beginning, but starts from the set position, so it can be changed to random access.

  1. File "Open" and "Close" Operations

When the user requests multiple reads / writes or other operations on a file , he must start from the retrieval directory each time. In order to avoid repeatedly retrieved entry recorded in most OS are incorporated in the "open" (open) of the file system calls, when the user operates the first request for a file, you must first use the open system call The file opens. The so-called "open" means that the system will copy the attributes of the named file (including the physical location of the file on the external storage) from the external storage to an entry in the memory open file table, and number the entry (or called Index number) is returned to the user. In other words, "open" is to establish a connection between the user and the specified file. After that, the user can directly obtain the file information through the connection, thereby avoiding searching the file again through the directory, that is, when the user issues a file operation request to the system again, the system can directly find the file in the open file table according to the index number provided by the user information. This not only saves a lot of search overhead, but also significantly improves the operation speed of the file. If the user no longer needs to perform the corresponding operation on the file, he can use the "close" (close) system call to close the file, that is, disconnect the connection, the OS will remove the file from the entry in the file table Delete it.

6.2 Logical structure of files

(1) File Logical Structure. This is the file organization viewed from the viewpoint of the user, i.e., a series of logical files are composed of records, and user data can be processed directly to the structure, which separate stand physical properties file, the file is also known Organization (File Organization).

(2) The physical structure of the file, also known as the storage structure of the file. This refers to a form of storage organization formed by the system storing files on external storage, which cannot be seen by users. The physical structure of the file is not only related to the storage performance of the storage medium, but also to the external memory allocation method used. No perish is the logical structure of the document or its physical structure, both will affect the speed of retrieval of documents.

1. Logical structure

1) There are structure files (recorded files)

In the record file, each record is used to describe an entity in the entity set, and each record has the same or different number of data items. The length of the record can be divided into fixed length and indefinite length.

(1) fixed length record means records the file length of all are the same, all data items are recorded at the same recording position in the s, s of the same length and having the sequence apricot, documents with The record number R indicates. Fixed-length records can effectively improve the speed and efficiency of retrieval records, and can facilitate the processing and modification of files, so this is a more commonly used record format, which is widely used in r data processing.

(2) Variable length records refer to the different lengths of records in the file. Variable length record causes may be due to a number of data items contained in the record is not the same, as the book author, keywords and other papers, it may be the number of length variable data item itself,

2) Unstructured file (streaming file)

If in the largest and most information management systems and database systems, the widespread adoption of non- documentary form the structure of words (ie the file is fixed-length or variable-length records composed), then run in the system a lot of source code, can be Execution files, library functions, etc., are used in the form of unstructured files, that is, streaming files. The length of the file is the access to the streaming file in bytes. It uses the read and write pointers to indicate the next character to be accessed. You can think of a streaming file as a special case of a recorded file: a record is only one byte.

2. Organization

The organization of the file, the file may be structured to be divided into five categories:

(1) Sequential file refers to a file formed by arranging a series of records in a certain order, where the records can be fixed-length records or variable-length records.

(2) Index file refers to creating an index table for variable-length record files and setting an entry for each record to speed up the retrieval of records.

(3) Index sequence file, which is the product of the combination of sequence file and index file. Here, when creating an index table for each file, it is not a index table entry for each record, but a group The first record in the record creates an index entry.

(4) Direct file

The keyword itself determines the physical address and key-value translation.

(5) Hash file

 

 

Guess you like

Origin www.cnblogs.com/giaogiaogiao/p/12760804.html