Limited Copyright Waiver
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
Background of the Invention
1. Field of the Invention
The present invention relates generally to reading of data from compressed data files, and more specifically to a method and an apparatus for decompressing and reading only a minimum subset of a compressed data file directly into memory.
2. Description of the Background
Compressed data residing in a data file must generally be decompressed in order to be of any real use. However, if access to only a small portion of the data file is needed, it is wasteful of computational resources to decompress the entire file. CPU time is unnecessarily wasted decompressing the file, and storage space is unnecessarily wasted holding the unneeded portions of the decompressed data.
Presently-available data decompressors appear to suffer both these faults. When a program issues an access request to a compressed file, the data decompressor decompresses the entire file and stores the decompressed version for access by the program. While the data decompressor is operating, the program must wait. If the data decompressor cannot allocate storage for the decompressed file, unknown errors may occur or the results may be otherwise unpredictable.
For example, if the compressed data file is on a disk which has less free space than the decompressed version of the file, the data decompressor may be unable to operate.
Additionally, existing data decompressors do not operate at the same level of logical operation at which most computer programs operate. Specifically, while computer programs tend to issue access requests to a certain file (i.e. on a file basis), existing data decompressors tend to operate at the much lower level of an operating system (i.e. on a block basis, disk basis, device driver basis, or the like).
This incompatibility of operational levels imposes certain additional inefficiencies on existing data decompressors. For example, existing data decompressors do not take sufficient advantage of the various read/write permission levels involved in data access requests. If a program opens a file "read only", for example, there is no need to save a permanent copy of the decompressed data, because it will ultimately be discarded when the program closes the file.
What is needed, therefore, is an improved method and apparatus for accessing data files on a file basis, and within the file basis, on the more limited basis of only a requested subset of the data content of a specified file. The improved method and apparatus should have a reduced usage of computational resources, by decompressing only a minimum amount of data. The improved method and apparatus should operate regardless of how much free storage is present on the medium on which the compressed file is stored. The method and apparatus should, additionally, take optimum advantage of access permission levels indicated by programs issuing data access requests.
Summary of the Invention
The present invention provides an apparatus and method for providing compressed data from a compressed data file in response to a data request which identifies given non-compressed data in a non-compressed data file. The method and apparatus identify, within in the compressed data file, given compressed data which correspond to the given non-compressed data identified by the data request, decompress the given compressed data to reconstitute the given non-compressed data, and provide the reconstituted non-compressed data in response to the data request.
The invention provides three operating modes, selected according to access level permission requested by an application seeking access to the file. A direct read mode is used for read-only permission; a file shadowing mode is used for read/write permission when it is likely that the application will only read from the file and never write to it; a file putback mode is used for read/write permission when it is likely that the application will write to the file.
The invention provides data caching for decompressed data blocks from a file, to avoid repetitious reading and decompressing of a data block containing two or more data requested at different times, to improve throughput and transparency of the system.
Brief Description of the Drawings
FIG. 1 illustrates the present invention as embodied in a computer system.
FIG. 2 suggests the overall operation of the invention in the control hierarchy of various levels of a computer system.
FIG. 3 shows the basic operation of the invention to decompress only requested portions of a data file into memory.
FIGS. 4A, 5A, and 6A are flowcharts demonstrating operation of the invention in response to file open requests in direct read, file shadowing, and file putback modes, respectively.
FIGS. 4B, 5B, and 6B are flowcharts demonstrating operation of the invention in response to data write requests, in the three modes.
FIGS. 4C, 5C, and 6C are flowcharts demonstrating operation of the invention in response to data read requests, in the three modes.
FIGS. 4D, 5D, and 6D are flowcharts demonstrating operation of the invention in response to file close requests, in the three modes.
FIGS. 7A-F illustrate operation of the invention to create, decompress, and move files in the file shadowing mode.
FIGS. 8A-F illustrate operation of the invention to create, decompress, and move files in the file putback mode.
FIG. 9 illustrates one exemplary file format of a file which may be advantageously used with the present invention.
FIG. 10 illustrates the invention as embodied on a recording medium such as a floppy disk.
Detailed Description of the Preferred Embodiments
I. Components of the Invention
FIG. 1 shows the present invention as embodied in a computer system 100 having a storage system 102, a memory system 104, and a central processing unit (CPU) 106 coupled together by a bus 108. The storage system may, for example, be a hard disk drive. The memory system may, for example, be random access memory (RAM). These may also be characterized as permanent and temporary storage, respectively. The present invention may be practiced using a variety of data processing environments. However, the preferred environment is a data processing computer having a CPU, memory, and a permanent storage device.
FIG. 10 illustrates the invention as embodied in a floppy disk or the like, and may be understood to represent any appropriate recording medium upon which the invention may be embodied and from which the invention may be retrieved and/or executed. Other such media include hard disks, removable hard disks, optical discs, PROMs, and the like.
FIG. 1 shows that, at a highest level of abstraction, the present invention may be characterized as an apparatus and method for decompressing only a requested portion 110 of a compressed data file 112 from the storage system to RAM. In practice, the decompressed portion 110 may include certain excess data 114 which are not requested, but which are nevertheless decompressed owing to the particular compression/decompression scheme employed.
The present invention is a direct read system 120 which may reside in RAM while in use. The basic components of the direct read system are a direct read means 122, a decompressor 124, a shadow means 126, a putback means 128, and a caching means 160. The direct read means further includes an operating system patcher 130, a compression checker 132, a data structure means 134, and a locator means 136.
Other components of the computer system may include an operating system 150 which provides a controlling interface to the system hardware. The computer system may further include an application program 152 which issues data file access requests. Such requests may include instructions for such file-oriented operations as "open file", "read data", "write data", "get file position", "set file position", "get end-of-file position", set end-of-file position", "close file", and the like. Data read and write requests may take on a variety of forms. For example, a data read request may specify "read X bytes starting at location Y", or it may specify "read bytes from location X to location Y", or the like. Either of these may be considered as directly or indirectly reciting a starting location, and ending location, and an amount of data.
According to known technology, these requests are ordinarily serviced by the operating system. However, the patcher 130 redirects these requests to be handled by the direct read system. Methods are known by which this is accomplished, such as by altering the contents of a "trap table" or by altering the instructions of the operating system itself. The exact means and methods of the patcher will depend on the particular computer system upon which it is desired to practice the invention.
The computer system may further include a data compressor 154 which compresses data files stored in the storage system. While the data compressor is not a necessary part of the present invention as such, it will be understood that the decompressor 124 is capable of utilizing the same compressed file format as the compressor 154. It will be further understood that the compressor may be included in the invention, to provide data re-compression, for example.
The preferred data compressor and decompressor are described in the cross-referenced applications. The block-oriented compression technique employed therein is ideally suited to use by the present invention, to permit decompression of minimized subsets of a compressed data file, to minimize the waste of computational resources otherwise used at each data request. Because the compression algorithm completely restarts itself for each successive history buffer of data (i.e. the data in one block are compressed entirely independently of data in another block), the present invention is able to extract and decompress only those blocks which contain requested data. FIG. 9 shows the general file format of a compressed data file, which is created by the data compressor and which is readable by the decompressor.
II. General Operation of the Invention
FIG. 2 illustrates how the present invention cooperates with an application program and an operating system, to provide a wholly-transparent, seamless interface between the application program and data files, whereby compressed data files can be accessed without modification of--or notice to--either the application program or the operating system.
When the application program issues a data file access request, such as those listed above, the request is intercepted by the direct read system before it arrives at the operating system. This ability is provided by the patcher. For example, the application program may issue the request "read the next byte from file X". The direct read system alters the request according to information retained by the data structure means and locator means. After modification, the request may be "read block Y from file X". The operating system receives this modified request; both the application and the operating system are unaware that the request has been modified. The operating system performs the indicated request, in this case reading block Y from file X.
Then, block Y is decompressed by the decompressor, to form block Y'. The direct read system then extracts the originally-requested byte from the block Y', and returns that byte to the application program. To the application program, the operation of the direct read system is transparent--the application program never knows that its original request was not simply handled by the operating system.
This permits the storage system to store an increased amount of data, without requiring modification of the application program or the operating system. Perhaps more importantly, it requires no intervention or special knowledge by a person using the application program.
The data compressor and decompressor disclosed in the cross-referenced applications have been selected for use in the present invention because their block-oriented nature allows decompression of less than an entire data file, and further because the decompressor is optimized to decompress at highly improved speeds. This dramatically improves the transparency of the present invention to a user. The user may be entirely unaware that decompression is taking place, even when performing operations with which the user has become intimately familiar in a wholly non-compressed environment.
FIG. 3 illustrates that a requested subset of a data file may be read into RAM in response to a data read request, for example. Blocks which do not include the requested data are not decompressed, and are not read into RAM. This reduces CPU time required for decompression, and reduces bus usage required for transfer from the storage system to RAM.
III. Operation of the Invention in Direct Read Mode
FIGS. 4A-D illustrate operation of the present invention in a read-only direct read mode, showing file open, write, read, and close operations, respectively.
A. File Open Request--Direct Read Mode
FIG. 4A shows operations beginning at node 402 when an application issues a data access request to open a file for read-only permission. Initially, at conditional block 404, the compression checker 132 in the direct read means 122 determines whether the indicated file is compressed, and if so, whether it is compressed using a format which the decompressor can decompress. According to the decompressor of the cross-referenced applications, this may be performed simply by consulting the global file header of the compressed file.
Throughout the remainder of this application, a file compressed in a format which the decompressor 154 can decompress will be referred to as a "direct read file". If conditional block 404 determines that the file is a direct read file, operation passes to block 406. There, the direct read system issues a request for the operating system to open the file. Upon opening of the file, operation continues at block 408, where the data structure means 134 creates data structures for the open file. These data structures will be described below in Section VII regarding "Access to Individual Blocks".
Then, at block 410, the direct read system returns to the application program that file information which the application program would ordinarily expect to receive directly from the operating system. Such information may include, for example, a file number, file size, current file pointer value, and the like.
If, at conditional block 404, it is determined that the file is not a direct read file, operation passes to block 412, where the direct read system simply hands off the file open request to the operating system. At this point, the direct read system, in essence, "takes itself out of the loop" regarding the particular file. Then, at block 410, the operating system itself returns the proper file information to the application program, entirely bypassing the direct read system.
In either case, the file open operation is complete at node 414.
B. Data Write Request--Direct Read Mode
FIG. 4B illustrates operation of the invention in response to a write request in read-only mode. Operation begins at node 420, when the application program issues the request. Then, unknown or undefined operations are performed by the operating system at block 422, because of the illogical request for writing to a read-only file. Typically, the application program will receive an error message result from the operating system, and no data will be written.
C. Data Read Request--Direct Read Mode
FIG. 4C illustrates data read operations beginning at node 430, when the application program issues a data read request. Operation continues at conditional block 432, where the compression checker determines whether the file is a direct read file.
If it is a direct read file, operation continues at block 434, where the locator means 136 identifies which blocks of the compressed data file contain the requested data. Then, at block 436, the decompressor 124 decompresses those blocks into RAM. Then, the specifically-requested bytes of those blocks are copied into the buffer where the application program expects to receive them.
At conditional block 432, if the file is not a direct read file, operation passes to block 438, where the direct read system takes itself out of the loop by handing the request off to the operating system for normal data read operations.
In either case, data read operations are complete at node 440.
D. File Close Request--Direct Read Mode
FIG. 4D illustrates operation of the direct read system in response to a file close request issued by the application program at node 450. Operation continues at conditional block 452, where the compression checker determines whether the file is a direct read file.
If it is a direct read file, operation continues at block 454, where the data structure means 134 discards any data structures used for the file and the caching means 160 de-allocates any cached portions of the decompressed data. Then, at block 456, the direct read system issues a request for the operating system to close the open direct read file.
At conditional block 452, if the file is not a direct read file, operation passes directly to block 456. In either case, file close operations are complete at node 458.
IV. Operation of the Invention in File Shadowing Mode
FIGS. 5A-D illustrate file open, data write, data read, and file close operations of the direct read system when operating in file shadowing mode. In the interest of clarity, FIGS. 5A-D do not show conditional blocks determining whether the request involves a direct read file. It will be understood that, as in FIGS. 4A-D, if other than a direct read file is involved, the direct read system will hand off the request for normal operations by the operating system.
Direct read operations in file shadowing mode are performed by the direct read means, just as in normal read-only direct read mode. Additional features of file shadowing mode are provided by the shadow means, and will be described below, with reference to FIGS. 5A-D and FIGS. 7A-F.
A. File Open Request--File Shadowing Mode
FIG. 5A shows operations of the direct read system in file shadowing mode. File shadowing mode is entered at node 502 when an application requests to open a file for read/write permission in circumstances indicating that the application will most likely only read from, and not write to, the file.
At block 504, the direct read system issues a request for the operating system to open the compressed file. Then, at block 506, the shadow means determines the decompressed (expanded) size of the entire file. As indicated in the cross-referenced applications, this information may be obtained by simply consulting the global file header of the compressed file.
Then, at block 508, the shadow means issues a request for the operating system to open a shadow file of this decompressed size. In one mode, this request may include a first request to open a file, and a second request to set the end-of-file marker to the indicated position. Thus, the shadow file will be sufficiently large, but will contain garbage. At this point, the shadow file serves only as a "placeholder" file, ensuring that sufficient storage is reserved to hold the entire file upon a subsequent decompression. The shadow file may, in one mode, be stored in a separate location from the original, compressed data file.
FIG. 7A shows the compressed data file as residing in an original location in the storage system, while the storage system further includes a temporary storage location. In one mode, the original and temporary locations may be distinct "directories" or "folders" in the storage system. In other modes, they could be separate hard disks, or the like.
FIG. 7B shows the compressed data file residing in its original location, and the shadow file residing in the temporary location.
File open operations are complete at node 510.
B. Data Write Request--File Shadowing Mode
FIG. 5B illustrates operation of the shadow means in response to a data write request issued by the application program at node 520. Operation continues at conditional block 522, where the shadow means determines whether the shadow file is still only a placeholder, or, in other words, whether the compressed data file has yet been decompressed.
If the file has not been decompressed, operation passes to block 524, where the decompressor decompresses the entire data file into the shadow file. FIG. 7B shows the shadow file as a placeholder, while FIG. 7D shows the shadow file as including decompressed data.
From block 524, operation passes to block 526, where the shadow means issues a request for the operating system to move the shadow file from the temporary location to the same location as the compressed data file, as seen in FIG. 7E. From block 526, operation passes to block 528, where the shadow means issues requests for the operating system to close and delete the original compressed data file, as seen in FIG. 7F.
From block 528, operation passes to block 530, where the data write request is handed off to the operating system, which performs the data write to the decompressed shadow file. If, at conditional block 522, it is determined that the file had already been decompressed, operation passes directly to block 530. In either case, the write is complete at node 532.
C. Date Read Request--File Shadowing Mode
FIG. 5C illustrates operation of the direct read means and the shadow means in response to a data read request from an application program at node 540. From there, operation continues at conditional block 542, where the shadow means determines whether the file has been decompressed.
If the file has not yet been decompressed, the file is still eligible for ordinary direct read usage, identical to that of the read-only direct read mode, as seen in FIG. 7A. Thus, operation passes to block 544, where the direct read means locates the appropriate blocks of the compressed data file. Then, operation continues at block 546, where the decompressor decompresses those blocks into RAM and copies the requested bytes into the application program's buffer.
If, at conditional block 542, it is determined that the file has already been decompressed, as seen in FIG. 7F, operation passes to block 548. At block 548, the shadow means issues a request for the operating system to read the indicated bytes from the decompressed shadow file. In either case, read operations are complete at node 550.
D. File Close Request--File Shadowing Mode
FIG. 5D illustrates operation of the shadow means and the direct read means in response to a file close request issued by the application program at node 560. From there, operation continues at conditional block 562, where the direct read means determines whether the file has been decompressed.
If it has not been decompressed, operation passes to block 564, where the shadow means issues requests for the operating system to close and delete the shadow file. Note that if the file was never decompressed, this is because it never became "dirty", or, in other words, it was never written to. The only thing which block 564 will delete is a garbage-containing placeholder shadow file.
From block 564, operation passes to block 566, where the direct read means issues a request for the operating system to close the open direct read file. Thus, although the file was opened for read/write permission, it was only used for reading. In this situation, the history of the files is described by the sequence: FIG. 7A, FIG. 7B, FIG. 7C.
If, at conditional block 562, the file was determined to have been decompressed (i.e. written to), operation passes to block 568. At block 568, the shadow means issues a request for the operating system to close the open decompressed shadow file. In this situation, the history of the files is described by the sequence: FIG. 7A, FIG. 7B, FIG. 7D, FIG. 7E, FIG. 7F. Note that the file is left in a decompressed state. The compressor may subsequently be used to re-compress the file, if desired. This process could, optionally, be incorporated into the close operation, by making the compressor an integral part of the direct read system.
In either case, file close operations are complete at node 570.
V. Operation of the Invention in File Putback Mode
FIGS. 6A-D illustrate file open, data write, data read, and file close operations of the direct read system when operating in file putback mode. In the interest of clarity, FIGS. 6A-D do not show conditional blocks determining whether the request involves a direct read file. It will be understood that, as in FIGS. 4A-D, if other than a direct read file is involved, the direct read system will hand off the request for normal operations by the operating system.
Direct read operations in file putback mode are performed by the direct read means, just as in normal read-only direct read mode. Additional features of file putback mode are provided by the putback means, and will be described below, with reference to FIGS. 6A-D and FIGS. 8A-F.
A. File Open Request--File Putback Mode
FIG. 6A shows operations of the direct read system in file putback mode. File putback mode is entered at node 602 when an application requests to open a file for read/write permission in circumstances indicating that the application will most likely write to the file.
At block 604, the direct read system issues a request for the operating system to open the compressed file. Then, at block 606, the putback means determines the decompressed (expanded) size of the entire file. FIG. 8A shows the compressed data file in its original location.
Then, at block 608, the putback means issues a request for the operating system to open a putback file of this decompressed size, in the same location. Then, operation continues at block 610, where the decompressor decompresses the entire data file into the putback file, as seen in FIG. 8B.
After decompression, operation passes to block 612, where the putback means issues requests for the operating system to close the original compressed data file and move it to the temporary location, as in FIG. 8C.
File open operations are complete at node 614.
B. Data Write Request--File Putback Mode
FIG. 6B illustrates operations of the putback means in response to a data write request issued by the application program at node 620. Operation passes to block 622, where the putback means issues a request for the operating system to write the indicated data to the decompressed putback file, rather than to the compressed data file as originally indicated by the application's request. Write operations are complete at node 624.
C. Date Read Request--File Putback Mode
FIG. 6C illustrates operations of the putback means in response to a data read request issued by the application program at node 630. Operation passes to block 632, where the putback means issues a request for the operating system to read the indicated data from the decompressed putback file, rather than from the compressed data file. Read operations are complete at node 634.
D. File Close Request--File Putback Mode
FIG. 6D illustrates operation of the putback means and direct read means in response to a file close request. At node 640, the application program issues the request. Operation continues at conditional block 642, where the putback means determines whether the file has been written to.
If the file has not been written to, operation passes to block 644, where the putback means issues a request for the operating system to move the compressed data file from the temporary location back to its original location, as seen in FIG. 8D. Then, at block 648, the putback means issues a request for the operating system to delete the decompressed putback file, as seen in FIG. 8E.
If the application did not write to the file, the history of the files is described by the sequence: FIG. 8A, FIG. 8B, FIG. 8C, FIG. 8D, FIG. 8E.
If, at conditional block 642, the putback means determines that the application program wrote to the file, operation passes to block 650, where the putback means issues a request for the operating system to close the open decompressed putback file. Then, at block 652, the putback means issues a request for the operating system to delete the compressed data file from the temporary location, as seen in FIG. 8F.
If the application wrote to the file, the history of the files is described by the sequence: FIG. 8A, FIG. 8B, FIG. 8C, FIG. 8F.
Thus, what is "put back" into the original location will be either the original compressed data file or the decompressed data file, depending on whether the application program wrote any data to the file. In either case, file close operations are complete at node 654.
VI. Caching
It is highly undesirable that the apparatus and method would have to fetch and decompress an entire block of data each time an application program requested a single byte, for example.
FIG. 1 shows that, in order to prevent this, the direct read system includes caching means 160 for storing one or more decompressed data blocks for each open file.
FIG. 2 illustrates This feature. The first time an application program requests data from a file, the direct read means must rely on the operating system to fetch a compressed block from the permanent storage medium, and must further rely on the decompressor to decompress the block into an output buffer. Then, the requested data are provided to the application program by the direct read system.
On a subsequent request for data in the same block, the direct read system need not invoke the operating system nor the decompressor, because the block will already be stored in a decompressed form in one of the particular file's cache blocks. Thus, the direct read system receives the data read request, and immediately provides the requested data to the application program from the cache block.
In one mode, a block is cached only if both: it is the last block involved in a data request, and it contains data beyond that requested. In other words, a block is cached if at least one byte in the block's latter portion was not yet requested. This mode is selected based upon the likelihood that once an application program has accessed an entire data block, the application program is less likely to make subsequent requests for the same data again. It is further selected based upon the likelihood that, once an application program has requested given data in a block, there is a high likelihood that immediately subsequent data in the block will later be requested by the application program.
In one mode, up to twelve cache blocks are maintained for each file, as needed. It is believed unlikely that an application program will read partial blocks from more than twelve locations in a file, in a manner such that caching of additional blocks would be advantageous.
VII. Access to Individual Blocks
A. Use of Block Tables
As shown in FIG. 9, and according to the file format taught in the cross-referenced applications, a compressed data file includes a block table which provides access to the individual blocks of the compressed data file.
Although each compressed block represents the same quantity of non-compressed data, such as eight kilobytes, each compressed block does not necessarily include the same quantity of compressed data.
Therefore, the block table entries may contain offsets from a predefined reference point to the beginnings of the respective compressed data blocks. The offsets may be measured from the beginning of the file as a whole, for example. Thus, in response to a data read request specifying "read X bytes starting at location Y in file Z", the data structure means 134 and the locator means 136 may access the block table of file Z to gain access to the particular blocks effectively containing bytes Y through Y+X-1 of the file.
In one mode, the data structure means 134 and the locator means 136 may sequentially scan the block table entries until it finds the block containing byte Y, and the block containing byte Y+X-1. The data structure means and the locator means must, of course, take into account the size of the global file header, if the block table entries indicate offsets from the absolute beginning of the file, rather than from the beginning of block 0.
It will be understood that, if the data access request specifies less than the entire data file, the locator means may identify less than all blocks in the compressed data file. The decompressor will then selectively decompress only those identified blocks, without decompressing other, non-specified blocks.
In one mode, the block table merely points to the beginning locations of the respective blocks. In this mode, the data structure means and the locator means must further consult the block headers to determine how much non-compressed data each block effectively holds, in order to determine what blocks are involved in a given data access request. In another mode, the block table entries may each further include a copy of the expanded data size field from the corresponding block header. In this mode, the data structure means and the locator means need not consult the block headers in order to build data structures providing access to the respective blocks.
As is explained in the cross-referenced applications, the block table can be reconstructed if that portion of the file is damaged. The global file header is a known, fixed size. Therefore, the block header for block 0 begins at a known, fixed position in the file. Block header 0 contains a field indicating the compressed size of block 0. Therefore, the location of the beginning of block header 1 can readily be determined, and so forth. Therefore, the locator means may include means for reconstructing a damaged block table from the block headers.
As is further indicated in the cross-referenced applications, each block header includes checksums generated over both the block and the block header itself. This information may be utilized to reconstruct at least some portions of a block table which has been damaged, even if one or more of the blocks and block headers have been damaged. Therefore, the locator means may include means for reconstructing some or most of a damaged block table from damaged blocks and block headers.
B. Data Structures
Those skilled in the art will appreciate that the following description of the source code and of the data structures is for teaching purposes only, and that the source code speaks for itself.
As is seen in the attached Software Source Code Appendix, each direct read file will have an associated "FileStruct" which contains the data structure entries for the particular file. Each "FileStruct" includes "DRCommonItems", and may optionally include other items as well.
The FileStruct structures for read-only direct read files and shadow files are stored in a doubly-linked list, as indicated by the items "*next" and "*prey" in "DRCommonItems". Putback files and their associated compressed data files are handled within a simple array (not shown), which is kept separate from the direct read and shadow files for purposes of speed. Other modes are, of course, feasible within the scope of this invention. When a direct read file is opened, the data structure means creates for it a "FileStruct" and adds it to the doubly-linked list.
The item "algorithm" indicates whether the file is compressed, and if so, by what method. When a direct read file is opened, the data structure means sets the "algorithm" item according to what compression method was used, as indicated by the file's global file header.
The items "logicalEOF" and "logicalFPos" are used to keep track of where the application program thinks it is in a non-compressed data file. These values are used and updated by the direct read means and the shadow means.
The item "shadowFileRef" ties a direct read file to a shadow file. The item "compFileRef" ties a shadow file back to its compressed data file. These values are used and set by the shadow means.
The item "ddHeader" is filled by the data structure means according to a global file header in a given direct read file, and can be understood from the cross-referenced applications. The shadow means uses a "expSize" field from the "ddHeader" to determine how large a shadow file the operating system should be requested to create.
The item "**offsets" is a handle to a "PairOffsetsStruct", and is filled by the data structure means according to the offsets table of the particular direct read file. Specifically, the item "offsets[]" is a dynamically-allocated array of offsets to the various data blocks. The locator means uses the "offsets[]" to identify which compressed block(s) in a file are involved in a given data access request.
The item "cacheList" points to a doubly-linked list of cache blocks for the file, and is maintained and used by the caching means. Each cache block is contained in a "CacheBlock" as shown. The cache blocks for a given file are stored in a doubly-linked list by the items "**next" and "**prev". The cached block's bytes are stored in the dynamically-allocated item "bytes[]".
The usage of the other items will be understood from the source code itself.
VIII. Conclusion
While the invention has been described with reference to the embodiment of a data compression system, its use in any suitable embodiment is contemplated. Various aspects of the invention's cooperation with an operating system may be incorporated directly into the direct read system itself. For example, the direct read system could directly move or delete files, rather than using the more conventional method of using an available operating system. It will also be understood that the terms "application program" and "operating system" may be used somewhat interchangeably.
These and various other changes in the form and details discussed herein are possible within the scope of this disclosure, including but not limited to those discussed above. However, the invention is to be afforded protection according to the scope of the following claims. ##SPC1##