Directory management system

Abstract: A directory management apparatus for managing data or a directory using directories, includes a data input unit for inputting data, an attribute information generating unit for generating attribute information indicating a directory to which the data input from the data input unit belongs or a directory to which the directory belongs, and a recording unit for recording the data input from the data input unit, and the attribute information generated by the attribute information generation unit on a recording medium.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a directory management system for managing files recorded on an information recording medium, in which recorded data cannot be rewritten, using hierarchical directories. Related Background Art Conventionally, a directory management system is known as a technique for managing data recorded on an information recording medium. In the directory management system, information called a directory entry for managing a file consisting of a data block is generated, information called a directory as a group of directory entries is recorded, and individual files are managed using the directory. Conventional file management is performed by recording file information on an information recording medium such as a magnetic disk, in which recorded data can be rewritten, and is performed by a hierarchical directory management system for managing files in a hierarchical structure. An example of the hierarchical directory management system will be explained below. In the hierarchical directory management system, directories are dealt like normal files, and files are managed in units of directories. The uppermost directory is called a root directory, and other lower directories are called sub directories. Furthermore, an upper directory of a given sub directory is called a parent directory. Fig. 3 shows a model of a hierarchical directory structure. Fig. 3 illustrates a root directory Root, normal files F1 to F4, and sub directories A and B. In the root directory, directory entries of the file F1 and the sub directory A are recorded. In the sub directory A, directory entries of the file F2 and the sub directory B, and directory entries of the root directory as a parent directory of the sub directory A, and the sub directory A itself are recorded. In the sub directory B, directory entries of the files F3 and F4, and directory entries of the sub directory A as a parent directory of the sub directory B, and the sub directory B itself are recorded. When an access target is changed from the root directory to the sub directory A, the sub directory A is read out from a recording medium using the directory entry of the sub directory A in the root directory, and a file managed by the directory A is accessed using a directory entry included in the sub directory A. When an access target is changed from the sub directory A to the root directory, the root directory is read out from the recording medium using the directory entry of the root directory in the sub directory A, and a file managed by the root directory is accessed using a directory entry included in the root directory. Fig. 9 exemplifies a directory entry format on a magnetic disk. As shown in Fig. 9, the directory entry format includes, as file information, a file name 501, an attribute 502, position information 503, and a file size 504. Of these pieces of information, the file name 501 is named by a user to identify a file. The attribute 502 is information for identifying whether information indicated by a directory entry is a normal file or a sub directory. When the attribute indicates a sub directory, the corresponding directory entry indicates a group of directory entries, i.e., a directory. The position information 503 is information indicating a position of a magnetic disk where a file begins to be recorded, and the file size 504 indicates an effective byte count of a file. In the sub directory, the directory entries of a parent directory and the sub directory itself are recorded. Thus, access from a given directory to another directory is enabled, thus realizing a hierarchical directory structure. In this management system, files are managed in units of directories. When an access target is changed from a given directory to another, the destination directory is read out from an information recording medium using a directory entry of the destination directory. In this structure, when a directory is edited by, e.g., adding or updating a file, for example, when a new file F5 is added to the sub directory A, a directory entry for managing the file F5 is added to the sub directory A, thus re-recording the entire sub directory A. When the content of the file F5 is edited, the directory entry for managing the file F5 in the sub directory A is edited, thus re-recording the entire sub directory A. In this manner, every time a directory entry is edited, all the pieces of information in a sub directory or a root directory including the edited directory entry are re-recorded. However, when the above-mentioned hierarchical directory management system is executed in an information recording medium, in which recorded data cannot be erased, every time a file is added or edited, a new sub directory or root directory must be added, and directory entries, which need not be edited, must be re-recorded. As a result, many non-edited directory entries are repetitively recorded, and are undesirably left unerased. Thus, the effective recording capacity is decreased, and directory search time is prolonged. It is a concern of the present invention to provide an improved directory management system. European Patent Specification EP A2 0260115 discloses an information record medium having an area for recording data and an area for recording a directory used to manage the recorded data by providing an area for recording information indicating logical erasure of unnecessary data. PCT Patent Specification WO 89/01663 discloses a system for recording and retrieving data particularly suited to write-once media. US Patent Specification US 4682318 discloses a method of updating an optical disc which includes directory blocks in such a manner that the addition of new directory information requires the alteration of less than all of the directory blocks. European Patent Specification No. EP A2 0165382 discloses self-archiving in which all previous recordings related to respective files or data sets are pointed to in a directory. An article in "PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON DATA ENGINEERING 1984, SILVER SPRINGS, U.S.A., pages 175-180, P. RATHMANN: "Dynamic data structures on optical disks" also relates to data storage and retrieval in a write-once system. In accordance with a first aspect of the present invention there is provided an information processing apparatus as set out in Claim 1. In accordance with a second aspect of the invention there is provided a method of managing a directory as set out in Claim 6. The present invention provides a directory management system which can effectively utilize a recording area of a recording medium. The present invention also provides a directory management system which can shorten directory search time. Further, the present invention provides a directory management system which is suitable for a recording medium in which recorded data cannot be erased. Other features of the present invention will become apparent from the following description given by way of example with reference to the accompanying drawings, in which: Fig. 1 is a block diagram showing an arrangement of an information processing apparatus using a directory management system according to an embodiment of the present invention; Fig. 2 shows a directory entry format in the embodiment shown in Fig. 1; Fig. 3 exemplifies a model of a hierarchical directory structure in the embodiment shown in Fig. 1; Fig. 4 shows a table of directory entry data recorded on an information recording medium in the embodiment shown in Fig. 1; Fig. 5 is a view showing a state wherein directory entries are developed in a hierarchical structure on a memory in the embodiment shown in Fig. 1; Fig. 6 shows a directory table used when the directory entries are developed in the hierarchical structure in the embodiment shown in Fig. 1; Fig. 7 is a schematic flow chart showing processing for converting the directory entries into the hierarchical structure in the embodiment shown in Fig. 1; Fig. 8 is a schematic flow chart showing recording processing in the embodiment shown in Fig. 1; and Fig. 9 exemplifies a conventional directory entry format used in a magnetic disk. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 is a block diagram showing an arrangement of an information processing apparatus using a directory management system according to an embodiment of the present invention. The information processing apparatus comprises a CPU 11 for executing various processing operations in this embodiment, a ROM 12 for storing a control program for the CPU 11, and the like, a RAM 13 used as a work area where the CPU 11 executes a control operation, an operation unit 14 used by an operator to input various data, a CRT 15 for making various displays for the operator, a scanner/printer 16 for reading/outputting image information, and an external memory unit 17 for filing various data on an information recording medium such as an optical disk, a hard disk, or the like. In the information processing apparatus, directory entries for managing corresponding files are independently recorded on the information recording medium. These directory entries are read out to a predetermined area in the RAM 13, and are converted into a hierarchical structure. Thus, an imaginary directory is formed on the predetermined area in the RAM 13, and files can be managed in a hierarchical structure. Fig. 2 shows an example of the format of a directory entry. A serial number 101 is information for identifying a given directory entry. A file name 102 is a name of a file indicated by the directory entry. An attribute 103 is used for discriminating a type of the directory entry. Position information 104 indicates a position (e.g., a sector address) of the recording medium where a file managed by the directory entry is recorded. A file size 105 indicates a size (a used sector count, a byte count, and the like) of a file managed by the directory entry. Parent information 106 is information for identifying a parent directory of the directory entry. Fig. 8 is a flow chart for recording data from the external memory unit 17 on a recording medium. The CPU 11 increments the current serial number by one (step S11), and requests an operator to input a parent directory of a file or directory to be recorded from the operation unit 14 (step S12). If no directory is recorded, a directory called a root directory is defined as the parent directory. The CPU 11 requests the operator to input, from the operation unit 14, an attribute indicating whether data to be recorded is a file or directory. If the input attribute is a file (step S13), file data is read from the scanner/printer 16 or is input from the operation unit 14 (step S14). The CPU 11 requests the operator to input a file name from the operation unit 14 (step S15). The CPU 11 then detects a file size of the input file data (step S16). Furthermore, the serial number, the file name, the attribute, the position information of the file on a recording medium, the file size, and the parent directory are recorded from the external memory unit 17 onto the recording medium (step S17). If there is another data to be recorded, the flow advances to step S11; otherwise, the flow returns to a main program (step S18). If it is determined in step S13 that the attribute is a directory, the CPU 11 requests the operator to input a directory name (step S19), and the serial number, the directory name, the attribute, and the parent directory are recorded from the external memory unit 17 (step S20). The flow then advances to step S18. In this manner, a file or a directory is recorded. These pieces of information can be recorded in any order. Fig. 3 shows a model of a hierarchical directory structure. Fig. 3 illustrates a root directory Root, normal files F1 to F4, and sub directories A and B. In this embodiment, pieces of information of the respective directory entries are properly set, so that directories in a hierarchical structure as shown in Fig. 3 can be developed on an imaginary directory development region allocated in a memory (RAM 13). Fig. 4 shows the directory entries recorded on the information recording medium in the format shown in Fig. 2. As shown in Fig. 4, the directory entries of the sub directories A and B, the directory entries of the files F1 to F4, and the files F1 to F4 are recorded on the recording medium. The serial numbers are added to the recorded directory entries in the order of their recording operations, and are used as pieces of parent information indicating parent directories of other directory entries. The serial number of the root directory is defined as 0 although the root directory is not recorded on the information recording medium. Therefore, the serial number "0" of the root directory is recorded in parent information of each of the directory entries of the file F1 and the sub directory A. An attribute indicates a normal file or a sub directory. When "f" is set in the attribute, it indicates a normal file; when "s" is set, it indicates a sub directory. A directory entry, in which the attribute indicates a sub directory, represents a sub directory name (in this embodiment, A or B) and parent information when data is read out and converted into a hierarchical structure. The directory entries of the sub directories A and B recorded on the recording medium do not include information of lower sub directories or files. For this reason, imaginary directories in a hierarchical structure must be generated on the basis of the directory entries read out from the recording medium. Furthermore, pieces of position information F1-TOP, F2-TOP, F3-TOP, and F4-TOP respectively indicate the positions of the files F1, F2, F3, and F4 on the recording medium. File sizes F1-SIZE, F2-SIZE, F3-SIZE, and F4-SIZE respectively indicate byte counts of the files F1, F2, F3, and F4. The position information and the file size are significant only when the attribute indicates a normal file. When the attribute indicates a sub directory, these pieces of information are insignificant. The directory entries can be written on and read out from the information recording medium one by one. The directory entries are read out in turn from the serial number "1". In the following description, the directory entries of the sub directories A and B will be referred to as directories A and B, and the directory entries of the files F1 to F4 will be referred to as directories F1 to F4. Fig. 5 shows imaginary directories obtained by reading out directory entry data (Fig. 4) recorded on the information recording medium, and developing them into a hierarchical structure on the imaginary directory development area in the memory (RAM 13). In Fig. 5, information "Root" indicates the beginning of directory entry data of the root directory, and information "subA" and information "subB" respectively indicate the beginnings of directory entry data of the sub directories A and B. "next" is information used for linking directory entries belonging to the root directory or a sub directory, and indicates an address of the linked next directory entry. Furthermore, "null" indicates that the linked directory entry is the last one. "forward" and "back" are pieces of information, which are set only when the attribute indicates a sub directory. Information "forward" indicates the start address of a parent directory, and information "back" indicates the start address of a first directory entry belonging to the sub directory. Fig. 6 shows a directory table used when the directory entry data shown in Fig. 4 are developed onto the memory, as shown in Fig. 5. This directory table is allocated on an area separate from the imaginary directory development area shown in Fig. 5 on the RAM 13. The directory table stores the serial numbers and start addresses of the root directory and sub directories. The directory table has a function of indicating the start address of a directory corresponding to parent information of directory entry data when the directory entry data is developed, and performing a search operation on the imaginary directory development area. In an initial state wherein none of directory entries are read out, information "null" indicating that no data is registered in the directory table shown in Fig. 6 is set. Note that the address of the root directory "Root" on the imaginary directory development area shown in Fig. 5, and the start address of the directory table shown in Fig. 6 are determined in advance. Fig. 7 is a schematic flow chart showing processing in which the CPU 11 converts directory entries recorded on the information recording medium into a hierarchical structure on the imaginary directory development area. The directory entries shown in Fig. 4 are read out from the information recording medium in the order of serial numbers, and parent information of each directory entry is read (S1). The directory table shown in Fig. 6 is looked up on the basis of the predetermined address to search for parent information, i.e., to check whether or not the directory table includes a serial number corresponding to the parent information read in step S1 (S2). If the directory table does not include the corresponding serial number, it is determined that the readout entry data is the first directory entry (S3). The predetermined skip destination address and the serial number "0" of the root directory are stored in the directory table (S3-1). If it is determined in step S3 that the directory table includes at least one serial number, processing in step S3-1 is omitted. The serial number on the directory table is searched based on the parent information read out in step S1, and the control skips to the start address of each directory on the imaginary directory development area shown in Fig. 5 on the basis of an address corresponding to the searched serial number (S4). The search operation is continued in the directory already registered on the imaginary directory development area to obtain information indicating a skip destination of the next directory entry (S5). When information "null" indicating the last directory entry is detected, the directory entry is registered on the imaginary direction development area (S6). Thereafter, the attribute of the directory entry is discriminated. If the attribute indicates a sub directory, the skip destination address of the parent directory of the sub directory is stored in the directory table (S7-1), and the serial number and the skip destination address of the directory entry of the sub directory are stored in the directory table (S7-2). If it is determined in step S7 that the attribute does not indicate a sub directory, steps S7-1 and S7-2 are omitted. It is checked if all the directory entries in the recording medium are read out (S8). The above-mentioned processing is repeated from step S1 until all the directory entries are read out. As described above, the directory entries in the recording medium are sequentially registered on the imaginary directory development area in the RAM 13, thereby generating directories in a hierarchical structure. The conversion processing will be described in detail below according to the contents of the directory entry data shown in Fig. 4. The directory F1 corresponding to the serial number "1" is read out (S1). In the directory F1, the attribute indicates a normal file, and parent information is "0". Thus, the serial number "0" is searched from the directory table shown in Fig. 6 (S2). However, since the directory table stores only information "null", it is determined that the directory F1 is the first directory (S3), and the serial number "0" and information "Root" indicating the beginning of the root directory are stored in the directory table (S3-1). The directory F1 is registered in the information "Root" on the imaginary directory development area (S4, S5, S6). At this time, information "null" is set in information "next" indicating the skip destination address to the next directory entry. Since all the directory entries are not read out (S7, S8), the directory A corresponding to the serial number "2" is read out (S1). In the directory A, the attribute indicates a sub directory, and parent information is "0". The serial number "0" is searched from the directory table (S2), and the control skips to the root directory "Root" on the imaginary directory development area as the skip destination of the serial number "0" (S3, S4). In this case, a search operation is repeated until information "next" of the directory entry in the root directory "Root" becomes "null" (S5). When the information "next" becomes "null", an address of the next directory entry to be registered on the imaginary directory development area is set in this information "next", and the directory A is registered using this address (S6). In this case, since the attribute of the directory A indicates a sub directory, information "Root" indicating the beginning of the root directory as a parent directory is set in information "forward" (S7, S7-1). Information "null" indicating that no data is registered is set in information "next" for accessing a directory entry belonging to the sub directory A. The address SubA at which the directory A is registered, and the serial number "2" are stored in the directory table (S7-2). The directory F2 corresponding to the serial number "3" is read out (S1). In the directory F2, the attribute indicates a normal file, and parent information is "2". The serial number "2" is searched from the directory table (S2). The control skips from the directory table to the address subA as a skip destination of the serial number "2" (S3, S4). Since information "null" is set in information "next" indicating a skip destination to a directory entry belonging to the directory A, it is determined that there is no directory entry belonging to the sub directory A (S5). An address on the imaginary directory development area, where the directory F2 is registered, is set in information "back" of the directory A, and the directory F2 is registered at this address (S6). When recording operations are performed as described above to register all the directory entries, the hierarchical structure shown in Fig. 5 can be obtained. In this embodiment, the directory entries are read out from the recording medium one by one. Alternatively, after all the directory entries are read out, they may be converted into a hierarchical structure. Files can be managed in the hierarchical structure shown in Fig. 3 using the directories developed on the imaginary directory development area in the RAM 13, as shown in Fig. 5. More specifically, when an access target is changed from the root directory to the sub directory A, a directory entry is searched from the root directory Root so as to access a file managed by the directory A of the sub directory A. When an access target is changed from the sub directory A to the root directory, the control can skip to "Root" as the beginning of the root directory on the basis of the information "forward" in the directory entry of the sub directory A, thus realizing access to files managed by the root directory. In this manner, the directory entries shown in Fig. 4 need only be recorded on the recording medium. A case will be explained below wherein a file is added or edited. For example, when a file F5 is added below the sub directory A, a directory entry of the file F5, which entry includes an attribute = normal file and parent information = serial number "2" of the sub directory A, is additionally recorded from the external memory unit onto the recording medium. The list of the directory A on the RAM 13 is searched to be linked with the directory B. When the file F5 is edited, a new directory entry of the file F5 is additionally recorded from the external memory unit onto the recording medium, and the content of a directory F5 on the RAM 13 is edited. When identical file names are detected upon conversion of directories into a hierarchical structure, a directory having a larger serial number, i.e., a directory recorded later, can be used as a significant directory. As described above, in this embodiment, since all the directory entries are read and are held on the memory, when an access target directory is changed, the target directory need not be read out from the recording medium again. When a directory is edited, only a directory entry to be edited is recorded, thus shortening a recording time. In the above embodiment, as information for identifying directory entries, serial numbers added to the directories are used. Information for identifying only a file name or each sub directory may be added, and may be used in identification. Means for converting directories into a hierarchical structure on the basis of attributes and parent information included in the directories is not limited to that of the above embodiment. According to the present invention, hierarchical directory management can be applied not only to a recording medium, in which recorded cannot be rewritten, but also to a recording medium, in which data can be rewritten. As described above, when a directory entry is edited by adding or editing a file, the directory entry to be edited need only be re-recorded. In particular, in hierarchical directory management for an information recording medium, in which recorded data cannot be rewritten, a recording capacity can be saved, and a search time can be shortened. As a storage medium, a write once read many optical disc may be employed. Although the invention is extremely advantageously employed to solve the problem with non-rewritable, non-erasable recording media, it will be realised that it could equally be employed on storage media which could in principle be rewritten or erased. Our earlier Application EP-A-0286308, incorporated herein by reference, describes an optical card medium and reading and writing thereon.

Claims: An information processing apparatus comprising: recording means (17) for recording a directory information on a recording medium; reading means (17) for reading the directory information recorded on the recording medium; managing means (11) for managing the directory in accordance with the directory information stored in said recording medium ; and first generation means (Fig. 8) for generating first directory information including first information (101, 102) for identifying a directory and second information (106) indicating a parent directory of the directory, said first directory information being recorded on the recording medium by said recording means; the apparatus being characterised by: second generation means (Fig. 7) for generating second directory information including the first and second information and third information indicating a child directory of the directory, on the basis of the first and second information of the first directory information read from the recording medium by said reading means; and storage means (13) for storing the second directory information generated by said second generation means; wherein said managing means manages the directory in accordance with the second directory information stored in said storage means. Apparatus according to claim 1, wherein the first directory information includes the name of the directory. Apparatus according to claim 1 or claim 2, wherein the recording medium is non-rewritable. Apparatus according to any preceding claim, wherein the recording medium comprises an optical recording medium. Apparatus according to any preceding claim, wherein the recording medium is detachable. A method for managing a directory in an information processing apparatus, comprising the steps of: recording a directory information on a recording medium; reading the directory information recorded on the recording medium; managing the directory in accordance with the directory information stored in said recording medium; generating first directory information including first information for indentifying a directory and second information indicating a parent directory of the directory; recording the first directory information on said recording medium; and reading the first directory information recorded on the recording medium; and characterized by generating second directory information including the first and second information and third information indicating a child directory of the directory, on the basis of the first and second information of the read first directory information, wherein the generated second directory information is stored in memory, and the directory is managed in accordance with the second directory information stored in the memory. A method according to Claim 6, wherein the first directory information includes a name of the directory. A method according to Claim 6 or Claim 7 wherein the recording medium is non-rewritable. A method according to any one of Claims 6 to 8, wherein the recording medium comprises an optical recording medium. A method according to any one of Claims 6 to 9 wherein the recording medium is detachable.

Inventors: OKUDA OSAMU, OKUDA, OSAMU
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06F17
IPC codes: G11B20, G11B27, G06F12, G06F17