File managing method

Abstract: A file managing method is disclosed. In the method, data is sequentially recorded with a predetermined continuous recording unit basis in a data section, and a flag indicative of addition of file data is provided in directories which manage file data. When data is additionally recorded into existing files, the data to be added is sequentially recorded into a data section as another file. The directories to manage the additional file data are recorded into a directory section by incrementing the flag. In the reproducing mode, the files having the same name and different flags are managed as a single file which has been divisionally recorded in accordance with the order of the numbers of the flags. In the recording mode of the additional data, if an invalid data section exists in the last recording information unit of the file into which the data is added, the data recorded in the last recording information unit is stored into a buffer memory and the data to be newly added is additionally sequentially recorded after the stored data. In the reproducing mode, the file other than the file whose flag has the maximum value among the files having the same file name and the different flags are managed as a recording unit region in which the last recording unit region is invalid.

Description: The invention relates to file management of an information recording medium and, more particularly, to file management when data is added to a file of an information recording medium in which erasing and rewriting operations cannot be performed. Hitherto, as information recording media, a floppy disk in which the recording and reproducing operations are executed by using magnetism, an optical information recording medium in which the recording and reproducing operations are executed by using a light, and the like have been known. As forms of the optical information recording media, various kinds of forms such as disc form, card form, tape form, and the like have been known. Among such optical information recording media, a card-shaped optical information recording medium (hereinafter, referred to as an optical card) is a medium in which a large demand is expected as a portable information recording medium of a relatively large capacity whose size and weight are small. The information recording media are mainly classified into a medium of the type in which the erasing and rewriting operations can be performed and a medium of the type in which the erasing and rewriting operations cannot be executed in dependence on characteristics of the medium. However, the erasing and rewriting operations of the optical card are generally impossible. The application of the optical card to the field such as a medical field or the like in which a point that the rewriting operation cannot be performed results in an advantage is expected. Generally, auxiliary data to manage data on a block unit basis in order to store a large capacity of data, namely, what is called a directory is used in an information recording medium. File information such as file name of a file to be managed by the directory, file length, leading data track number, and the like are ordinarily written into the directory, thereby executing a file management of the data section. The optical card, particularly, the optical card in which the erasing and rewriting operations are impossible has a large recording capacity although its size is similar to the size of credit card. To manage information of such a large capacity, a managing method of information by the directory is needed. Fig. 1 is a schematic plan view showing an example of an optical card. In Fig. 1, an optical card 1 has a data section 10 (10 1 , 10 2 , ..., 10 n ) comprising data tracks and a directory section 20 (20 1 , 20 2 , ..., 20 n ). Data is written into the data section 10 in the direction indicated by an arrow E from the upper portion of the optical card. Directory information as data management information is written into the directory section 20 in the direction indicated by an arrow D from the lower portion of the optical card 1. On the other hand, to manage data as a file, map information indicative of storage information of the file is also necessary in addition to the directory information as identification information to distinguish the file from another file. That is, there is needed information indicating from which track on the information recording medium the file is started, from which sector among sectors of several units obtained by dividing the track the file is started, or from which cluster as a management unit obtained by combining a plurality of sectors the file is started, and also indicating on which track (hereinafter, in the specification, explanation will be made on the assumption that the minimum recording unit and the management unit are set to one track) the files have been arranged in which order. Generally, such map information is called a file allocation table (FAT). Fig. 2 is a diagram for explaining the concept of the FAT. In Fig. 2, regions 1, 2, ..., N (generally, about 2500 regions) corresponding to the data tracks on the optical card are prepared for the FAT. The number of track on which the information subsequent to the information recorded on the track has been recorded is recorded in each region. For instance, in Fig. 2, the file starting from the region 1 continues to the regions 2 and 4. The file starting from the region 3 continues to the regions 5, 6, and 7. In Fig. 2, "FF" written in the region denotes that the file doesn't have any file to be continued, that is, "FF" indicates the last track of the file. "0" indicates that the track is an unused (no data is recorded) track. By using both of the directory and the FAT, the ID information such as a file name and the like and the leading track number can be known from the directory and the storage information can be known from the FAT, respectively, so that a file management can be efficiently executed. When considering an FAT to manage the files on a track unit basis, in order to record the FAT onto the optical card, assuming that the maximum track No. is set to 2500, 12 bits are needed for one region in Fig. 2 and 2500 regions are necessary. Thus, a capacity of (12 bits x 2500) = 30000 bits = 3750 bytes is needed. For instance, assuming that a capacity of one track is set to 512 bytes, such a capacity of 3750 bytes corresponds to a capacity of about 7.3 tracks. In the case of an erasable and rewritable medium, for the regions of the FAT, a predetermined region is prepared on the medium and in the case where there is a change in storage information as a result of that a new file has been recorded or the file has been updated, it is sufficient to rewrite the content in such the predetermined region to the latest information. In the case of a medium such as an optical card in which the erasing and rewriting operations are impossible, however, each time there is a change in storage information, it is necessary to additionally record a new FAT. For instance, each time a new file is added, the information recording capacity of eight tracks is used as an FAT in the above example. Assuming that the total number of tracks is set to 2500 as in the above example, even if all of the tracks are allocated to an FAT, only changes in the storage information of about 300 times (2500/8 = ABT. 312) can be permitted. Actually, since the data and directories are recorded, the number of tracks which are allocated to the FAT is further reduced. On the contrary, even if there are several changes in storage information at a time (for an interval from a time point when the optical card has been inserted into the recording and reproducing apparatus until a time point when it is ejected out), for instance, it is sufficient to record the FAT only once before the optical card is ejected out. Therefore, the above numerical value of about 300 times is merely a target value and the actual number of change times is not so largely deviated from the above value. In other words, a point that the FAT is recorded onto the optical card in which the erasing and rewritting operations are impossible causes a problem such that the information capacity of the optical card cannot be effectively used. To solve the above problem, it is not permitted to record data onto the track at random but it is permitted only to sequentially record data. In other words, the recording of a new file is certainly started from the next track of the last recording track at that time point and the data is sequentially recorded onto the subsequent tracks. With this method, the above problem can be solved. In this case, the first track number and the size (the number of tracks used) of file can be known from the directory information and the continuance of the information certainly exists on the next track. Therefore, even if the FAT is not recorded onto the optical card, the FAT can be constructed from the directory information. On the other hand, as a method of adding (appending) data into the file on an information recording medium in which the erasing and rewritting operations are impossible, the applicant of the present invention has proposed a method using an appending-flag in JP-A-1-258288. That is, a flag (appending-flag) indicative of the addition of file data is provided in the directory. When data is added into the existing file, the data to be added is recorded as another file. The directory to manage the additional data file (partial file) is recorded into the directory section by incrementing the appending-flag, thereby considering that the files whose names are the same and whose appending-flags differ can be regarded as one file which has divisionally been recorded in accordance with the order of the numbers of the appending-flags. Fig. 3 is a diagram for explaining the addition of data into the file by using the appending-flags and simulatively shows a data section. In Fig. 3, A and B denote file names and a numerical value in the parentheses indicates an appending-flag. For instance, reference numeral 201 indicates the first data (partial file) in the file A. Similarly, reference numeral 202 indicates the first data in the file B and 203 denotes the next data in the file A, that is, the data added to A(1). Although not shown in Fig. 3, the directory which manages each partial file has been recorded in the directory section. In Fig. 3, A(1) occupies the tracks 1 to m, B(1) occupies the tracks (m+1) to (n-1), and A(2) occupies the tracks (n) to (k). Assuming that data is recorded on a track unit basis, a size of file is not always integer times as large as a capacity of one track. Therefore, for instance, like the tracks (m) and (k) in Fig. 3, invalid data sections 204 and 205 generally exist on the last track of each file. When considering that the files A(1) and A(2) are combined and are regarded as a continuous one logical file A, as a theoretical file structure, the first portion of the file A(2) should exist in the invalid data section 204 and such a conversion needs to be executed. For this purpose, for instance, in the case of reading out the data on a byte unit basis, subsequent to the last valid byte of the track (m), the first byte of the track (n) needs to be read out, so that there is a problem such that the processes become complicated. Since the data reproduction is executed every track, a time required for the reproduction of one track is the same irrespective of the presence or absence of the invalid data section in one track. There is also a problem such that as the number of adding times increases, a vain time accordingly increases and it takes a long time for reproduction. The above problem is typical particularly in the case where a capacity of the file to be added and the data to be added is so small to be a fraction of the data capacity in one track. For instance, assuming that the file size is equal to 1/5 of one track, since one track is necessary for one addition, if the adding process is executed four times, the contents of all of the files corresponding to the recording capacity (1/5 x 5 = 1) of one track can be actually reproduced only by reproducing five tracks including the first file. According to the invention, there is provided a method of recording data on a non-rewritable recording medium as set out in claim 1. The invention also provides a recording apparatus as set out in claim 5. The invention yet further provides a method of reading data from a non-rewritable recording medium as set out in claim 9. The invention still further provides a reproducing apparatus as set out in claim 12. An embodiment provides a file managing method whereby data is sequentially recorded with a predetermined continuous recording unit basis in a data section, a flag indicative of the addition of file data is provided in directories which manage file data, when data is additionally recorded into existing files, the data to be added is sequentially recorded into a data section as another file, the directories to manage the additional file data are recorded into a directory section by incrementing the flag, and in the reproducing mode, the files having the same file name and different flags are managed as a single file which has been divisionally recorded in accordance with the order of the numbers of the flags, wherein in the recording mode of the additional data, if an invalid data section exists in the last recording information unit of the file into which the data is added, the data recorded in the last recording information unit is stored into a buffer memory and the data to be newly added is additionally sequentially recorded after the stored data, and in the reproducing mode, the files other than the file whose flag has the maximum value among the files having the same file name and the different flags are managed as a recording unit region in which the last recording unit region is invalid. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a schematic plan view of an optical card; Fig. 2 is an explanatory diagram showing the concept of an FAT; Fig. 3 is a diagram for explaining the addition of data to a file by using a conventional append flag; Fig. 4 is a flowchart showing an embodiment of a data adding recording process to a file according to a file managing method of the embodiment; Figs. 5A and 5B are explanatory diagrams schematically showing contents of data sections; Figs. 6A and 6B are explanatory diagrams schematically showing contents of directory sections; Fig. 7 is an explanatory diagram showing a content of data in a buffer memory of a host computer; Fig. 8 is a flowchart showing a process to form an FAT from directory information; and Figs. 9A to 9D are explanatory diagrams showing contents of the FAT formed by the process of Fig. 8. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of the invention will be described in detail hereinbelow with reference to the drawings. Fig. 4 is a flowchart of a recording process for adding data into a file according to a file managing method of the embodiment. In the embodiment, an example in the case of adding the file A(2) into a data section as shown in Fig. 5 will be explained. Fig. 5A shows a state before data is added. Fig. 5B shows a state after the data was added. The state of Fig. 5A is substantially the same as the state in which the file A(2) in Fig. 3 mentioned above is not recorded. Further, when the processing flow of Fig. 4 is executed, it is assumed that an optical card as a recording medium has already been set into an information recording and reproducing apparatus (not shown). In Fig. 4, in the step S101, a check is first made to see if all of the data on the last recording track of a file to be added is valid data or not. In this example, data on a last recording track (m) in a file A(1) shown in Fig. 5A is checked. The discriminating process in step S101 is performed by judging whether a file capacity in a directory 301 to manage the file A(1) recorded in the directory section as shown in Fig. 6 is integer times as large as a capacity of one track or not. That is, if YES, all of the data on the last recording track (m) is valid. If NO, invalid data exists. If it is determined in step S101 that the invalid data 204 exists as shown in Fig. 5A, valid data 306 in the file A(1) to be added as shown in Fig. 5B is stored into a buffer memory 400 in step S102. That is, the valid data 306 is stored as data 401 into the buffer memory 400 as shown in Fig. 7. In step S103, as shown in Fig. 7, data 402 to be added to the data 401 stored in the buffer memory is added after the data 401 in the buffer memory 400. Due to this, since the data to be recorded has been prepared in the buffer memory, the data in the buffer memory is sequentially recorded every track into the data section on the optical card in step S104. In this case, as shown in Fig. 5B, since the data 401 in the buffer memory is recorded as data 307 onto a track (n), the valid data 306 on the track (m), namely, the last recording track of the file A(1) to be added has been copied as data 307 of the track (n), namely, the leading track of an additional file data A(2). The data 402 in the buffer memory 400 is recorded as data 308. Finally, as shown in Fig. 6B, a directory 303 having the same file name as that of the directory 301 to manage the additional file data A(2) is recorded into the directory section in step S105. In this case, since the maximum appending-flag value of the directory to manage a file name A so far is equal to "1", the appending-flag in the directory information is increased by "1" and is recorded as "2". If all of the data on the last track is the valid data in step S101, it is vain to copy the data on the last track of the file A(1) to be added to the head of the additional file data A(2). Therefore, such data is not copied but the data to be added is prepared into the buffer memory and recorded in step S106. A processing procedure to make an FAT from the directory information in the reproducing mode will now be described with reference to a flowchart of Fig. 8. In Fig. 8, when the optical card is inserted into the information recording and reproducing apparatus, the directory information recorded in the directory section is first reproduced in step S501. That is, the directories 301 to 303 to manage the files A(1), B(1), and A(2) shown in Fig. 6B are sequentially reproduced. An FAT is formed in a memory of a host computer (not shown) on the basis of those information as will be explained hereinlater. Fig. 9A shows a state of the FAT at a time point when the directory 301 has been reproduced in step S501. A process to make the FAT shown in the diagram will be first explained. In step S502, a check is first made to see if a file which is managed by the directory is an additional file or not. In this case, since it is not an additional file, step S505 follows and a check is made to see if the file is the end of file or not. At this time, since the leading track number (in this example, track 1) in the directory information and the file capacity are known and the capacity of one track has been predetermined, the last track can be also known. Since the data has sequentially been recorded, as shown in Fig. 9A, the next track number "2" is recorded into the region 1 in step S506. The track number "3" is recorded into the region 2 in step S507. When the track numbers have been recorded into the respective regions as mentioned above and if the end of file has been detected in step S505, the processing routine advances to step S508 and "FF" indicative of the end of file is recorded into a region (m) corresponding to the last track. A check is now made in step S509 to see if any directory still exists or not. In this example, since the directory still exists, the processing routine is returned to step S501 and the directory 302 is reproduced. The FAT is updated on the basis of the above directory information by a method which is substantially the same as that mentioned above. Fig. 9B shows the FAT after completion of the updating. "FF" is recorded onto the last track and the processing routine is finished. Returning to step S501, the directory 303 is reproduced and the FAT is updated on the basis of the information. In this case, since the file name is the same as A which has been reproduced before and the appending-flag is equal to "2", it will be understood in step S502 that the file indicates the information added to the file A(1). In this case, therefore, in step 503, the content in the region (m) of the FAT corresponding to the last track (m) of the file of the same name in which the value of the appending-flag is smaller by one, that is, the added file A(1) is rewritten to "FE" indicative of the invalid track as shown in Fig. 9C. As shown in the diagram, in step S504, a region (n-1) of the FAT corresponding to a one-preceding track (m-1) of the last track is rewritten to n as a leading track of the file A(2). The updating process is executed as mentioned above. In step S509, since the directory which is not yet reproduced doesn't exist at that time point, "0" indicative of a non-used state is recorded to all of the remaining portions of the FAT in step S510. The making process of the FAT is finished. The last state of the FAT is shown in Fig. 9D. By constructing the FAT as mentioned above, in the case of reproducing the file A which is logically one file although it has physically separated and recorded into two portions, data is sequentially reproduced from the track (1) to the track (m-1) in accordance with the FAT. In the region (m-1) of the FAT, information indicating that the subsequent information of the file has been recorded on the track (n) exists, so that the track (n) can be reproduced without reproducing the track (m). On the other hand, since the valid data 306 recorded on the track (m) has been copied as data 307 to the head of the track (n), by continuously reproducing the tracks until the track in which "FF" indicative of the end of file has been recorded in the FAT, the added information can be continuously reproduced without a dropout of data. Moreover, all of the data on the tracks are only the valid data and a track (for example, track (m)) in which both of the valid data and the invalid data mixedly exist is not accessed. Consequently, even in the case of reproducing the data on a byte unit basis, it is sufficient to merely sequentially reproduce the data in accordance with the information indicated by the FAT without executing complicated processes by considering until which data on one track is valid. The file managing method of the embodiment also has an advantage such that in the case where an invalid data section exists on the last track of the file, the information on the last recording track of the file can be updated. That is, if an invalid data section exists on the last recording track, the data of the last track is once stored into the buffer memory. Therefore, if the data is updated in the buffer memory at that time point, the updated data is recorded to the head of the additional file, so that the data can be updated. If a size of file is equal to or smaller than (capacity of one track - one byte), all of the data can be updated. In this case, the directories to manage the files before updating exist as directory information. The directories having the same file name and different appending-flags as many as the number of updating times exist and all of the files of the same file name are recognized as one added file. However, since the mark "FE" indicative of the invalid track is recorded into the regions corresponding to the files in the FAT other than the file having the maximum appending-flag number, only the data of the last added (actually, updated) file can be eventually reproduced. In the case where the capacity of the file to be added and the data to be added is so small to be 1/N (N is an integer) of the data capacity in one track, the reproduction of N tracks as in the conventional apparatus is unnecessary until a time point when the capacity of all of the files reaches the capacity of one track by the addition of (N-1) times. The data of all of the files can be obtained by reproducing only one track on which the last additional file has been recorded on the basis of the information of FAT. Even if data has been recorded on a plurality of tracks by the addition of M (M is an integer larger than N) times, the reproduction of all of the M added tracks as in the conventional apparatus is unnecessary. It is sufficient to reproduce only the tracks (the number of such tracks can be expressed by int(M/N) when it is assumed that int( ) gives an integer part of the value written in the parentheses) in which all of the data on one track has become the valid data by the addition and the last track of the file. (Thus, the number of tracks which are reproduced is equal to int(M/N) + 1 and is obviously smaller than M.) Therefore, there are also advantages such that the number of tracks to be reproduced is small and the time which is required to reproduce is reduced. Although the above embodiment has been described on the assumption that the minimum recording unit and management unit are set to one track, they are not limited to the track but can be also set to a sector or a cluster. Although the embodiment has been described with respect to an example in the case where a file has been added once, if files have been added a plurality of number of times, it is sufficient to repeatedly execute the process similar to that mentioned above. As described above, according to the file managing method of the embodiment in the case where the file to which data has been added is reproduced every track, the added information can be continuously reproduced by merely sequentially reproducing from the leading track in accordance with the FAT. Moreover, since all of the data on each track are only the valid data, even if the data is reproduced on a byte unit basis, it is sufficient to merely sequentially reproduce the data in accordance with the information shown by the FAT without executing complicated processes. Even in the case of a medium in which the erasing and rewriting operations are impossible, if an invalid data section exists on the last track of the file, there is also an advantage such that the information on the last recording track of the file can be updated. Particularly, if a size of file is equal to or less than (capacity of one track - one byte), all of the data can be updated. Further, if the capacity of the file to be added and the data to be added is so small to be a fraction of the capacity of data in one file, there are many advantages such that the number of reproducing tracks to reproduce the whole added file is small, the time which is required to reproduce is reduced, and the like.

Claims: A method of recording data on a non-rewritable recording medium (1) having a file data region (10) for the recording of file data, and a directory region (20) for the recording of a directory for managing the file data, said method comprising the steps of: recording file data in the file data region such that the file data is sequentially recorded in recording units, each recording unit having a predetermined data capacity; and recording a directory on the directory region for managing the recorded file data; characterised in that said method further includes the steps of: when new file data is to be added to existing recorded file data to form one continuous logical file, detecting (S101) whether the existing recorded file data occupies a recording unit in which an amount of data recorded therein during said file data recording step is smaller than the predetermined data capacity of the recording unit; reproducing and storing (S102) file data from the recording unit in which the amount of the existing recorded file data thereof is smaller than the predetermined capacity; adding (S103) the new file data to the file data stored at said reproducing and storing step to produce composite additional file data and sequentially recording (S104) the composite additional file data in new recording units on the file data region; and recording (S105) on the directory region an additional directory for managing the additional file data. A method according to claim 1, further comprising the step of reproducing the existing file data and the new file data without reading the recording unit in which the amount of existing file data recorded therein is smaller than the predetermined data capacity of the recording unit. A method according to claim 1 or claim 2, wherein each recording unit comprises a track. A method according to any preceding claim, wherein the non-rewritable recording medium (1) comprises a card-like optical information recording medium. Recording apparatus for recording data on a non-rewritable recording medium (1) having a file data region (10) for the recording of file data, and a directory region (20) for the recording of a directory for managing the file data, the apparatus comprising: means for recording file data in the file data region such that the file data is sequentially recorded in recording units, each recording unit having a predetermined data capacity; and means for recording a directory on the directory region for managing the recorded file data; characterised in that the apparatus is arranged to operate so as to: when new file data is to be added to existing recorded file data to form one continuous logical file, detect whether the existing recorded file data occupies a recording unit in which an amount of data recorded therein during said file data recording step is smaller than the predetermined data capacity of the recording unit; reproduce and store file data from the recording unit in which the amount of the existing recorded file data thereof is smaller than the predetermined capacity; add the new file data to the file data stored in said reproducing and storing operation to produce composite additional file data and record sequentially the composite additional file data in new recording units on the file data region; and record on the directory region an additional directory for managing the additional file data. Apparatus according to claim 5, further comprising means arranged for reproducing the existing file data and the new file data without reading the recording unit in which the amount of existing file data recorded therein is smaller than the predetermined data capacity of the recording unit. Apparatus according to claim 5 or claim 6, wherein each recording unit comprises a track. Apparatus according to any of claims 5 to 7, wherein the non-rewritable recording medium (1) comprises a card-like optical information recording medium. A method of reading data from a non-rewritable recording medium (1) having (i) a file data region (10) with file data sequentially recorded therein in recording units of predetermined data capacity, the file data defining first (A) and second (B) files with the first file (A) comprising first (A(1)) and second (A(2)) parts whose file data is physically separated and recorded in respective portions of the file data region (10), the last recording unit (m) occupied by the first part (A(1)) of the first file (A) being only partially filled, and the first recording unit (n) occupied by the second part (A(2)) of the first file (A) including a copy of the file data from the first part (A(1)) which partially occupies the last recording unit (m) of the first part (A(1)), and (ii) a directory region (20) with a directory recorded therein for managing the file data; said method comprising: identifying the last recording unit (m) occupied by the first part (A(1)) of the first file (A) as invalid; and reading the first file (A) by sequentially reading the file data from the recording units occupied by the first file, missing out the file data from the recording unit identified as invalid. A method according to claim 9, wherein each recording unit comprises a track. A method according to claim 9 or claim 10, wherein the non-rewritable recording medium (1) comprises a card-like optical information recording medium. Reproducing apparatus for reproducing data from a non-rewritable recording medium (1) having (i) a file data region (10) with file data sequentially recorded therein in recording units of predetermined data capacity, the file data defining first (A) and second (B) files with the first file (A) comprising first (A(1)) and second (A(2)) parts whose file data is physically separated and recorded in respective portions of the file data region (10), the last recording unit (m) occupied by the first part (A(1)) of the first file (A) being only partially filled, and the first recording unit (n) occupied by the second part (A(2)) of the first file (A) including a copy of the file data from the first part (A(1)) which partially occupies the last recording unit (m) of the first part (A(1)), and (ii) a directory region (20) with a directory recorded therein for managing the file data; said apparatus comprising: means for identifying the last recording unit (m) occupied by the first part (A(1)) of the first file (A) as invalid; and means for reading the first file (A) by sequentially reading the file data from the recording units occupied by the first file, missing out the file data from the recording unit identified as invalid. Apparatus according to claim 12, wherein each recording unit comprises a track. Apparatus according to claim 12 or claim 13, wherein the non-rewritable recording medium (1) comprises a card-like optical information recording medium.

Inventors: HOSOYA HIDEKI, HOSOYA, HIDEKI, Hosoya, Hideki, c/o Canon Kabushiki Kaisha
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06F17
IPC codes: G11B27, G06F12, G11B20, G11B7, G06F17