JPS62192826A - File writing system - Google Patents

File writing system

Info

Publication number
JPS62192826A
JPS62192826A JP61036169A JP3616986A JPS62192826A JP S62192826 A JPS62192826 A JP S62192826A JP 61036169 A JP61036169 A JP 61036169A JP 3616986 A JP3616986 A JP 3616986A JP S62192826 A JPS62192826 A JP S62192826A
Authority
JP
Japan
Prior art keywords
file
writing
medium
recorded
end position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP61036169A
Other languages
Japanese (ja)
Other versions
JPH0451860B2 (en
Inventor
Hideo Matsumoto
秀男 松本
Yuji Tsuzuki
都築 雄二
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Nippon Telegraph and Telephone Corp
Original Assignee
NEC Corp
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp, Nippon Telegraph and Telephone Corp filed Critical NEC Corp
Priority to JP61036169A priority Critical patent/JPS62192826A/en
Publication of JPS62192826A publication Critical patent/JPS62192826A/en
Publication of JPH0451860B2 publication Critical patent/JPH0451860B2/ja
Granted legal-status Critical Current

Links

Abstract

PURPOSE:To execute a re-trial without leaving an ineffective file, by recording a position in an ended file medium, when a series of write processings have been ended, discriminating an effective file at the time starting the next processing, based on said recording and writing anew file from immediately after said discrimination. CONSTITUTION:When a file A has been recorded normally to a position X in a file medium 7, its position X is recorded as a file end position together with a file name A in a recording means 4. Subsequently, when a write instruction of other file B is given from a user program 5, a control means 1 makes a file end position recognizing means 2 read the position X of the means 4, and when an end-of-file has been recorded in the position X of the medium 7, the first block B1 of the file B is written immediately after the file A, and subsequently, blocks B2... are written and the file B is recorded.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はファイル書込み方式に関するものである。[Detailed description of the invention] [Industrial application field] The present invention relates to a file writing method.

ファイルの書込み方式として、ファイル情報を最終的な
ファイル媒体の位置に直接書込む方式と、−変則の領域
にファイル情報を書込み、正常な書込みを終えた時点で
最終的なファイル媒体の位置ヘコピーする方式とが知ら
れているが、コスト面や処理速度の面で前者の方式がを
利であるため、後者より一般に多く採用されている。
There are two file writing methods: one is to write file information directly to the final file medium location, and the other is to write file information to an irregular area and copy it to the final file media location when writing is completed normally. However, since the former method is more advantageous in terms of cost and processing speed, it is generally used more often than the latter.

前者のファイル書込み方式の一種であるVTOCファイ
ル書込み方式は、例えば第4tiJ (A)に示すよう
に磁気ディスク等のファイル媒体に既にファイルAが正
常に書込まれている場合、新たなファイルBの書込みは
同図(B)に示すようにファイルAの最後に記録された
エンド・オブ・ファイル(EOF)の部分から拡張モー
ドで行なわれ、EOFはファイルBの最後に記録される
。また、同図(C)はファイルBの書込み処理が何等か
の理由により途中終了したときの状態を示し、このよう
な場合にも途中終了した位置にEOFが書込まれる。
The VTOC file writing method, which is a type of the former file writing method, writes a new file B when file A has already been written normally on a file medium such as a magnetic disk, as shown in Section 4tiJ (A). Writing is performed in extended mode starting from the end of file (EOF) recorded at the end of file A, as shown in FIG. 3B, and the EOF is recorded at the end of file B. Further, FIG. 3(C) shows a state when the write process for file B is terminated midway for some reason, and in such a case, an EOF is written at the position where the write process ended midway.

〔従来の技術〕[Conventional technology]

ところで、上述のように何等かの理由によりファイルB
が途中終了した場合、その部分のファイルBは無効とな
り、再試行等によってファイルBの書込みを再度行なう
必要がある。この場合、従来のファイル書込み方式では
有効なファイルがどの部分までであるかを知ることがで
きなかったため、その際の方法としては、従来、次の何
れかの方法が採用されていた。
By the way, as mentioned above, for some reason, file B
If the process ends midway, that part of file B becomes invalid, and it is necessary to write file B again by retrying or the like. In this case, since it was not possible to know which part of the file was valid using the conventional file writing method, one of the following methods was conventionally employed in this case.

■ ファイル媒体の全体を消去して最初のファイルAか
ら書き直す方法 ■ 既に書込み済のファイルB部分は無効ファイルとし
て残し、EOF以降の領域に再度ファイルBの先頭から
書込む方法 〔発明が解決しようとする問題点〕 しかし、上記■の方法では、有効なファイル部分(ファ
イルA)についても再試行を行なうという無駄があり、
また再試行がファイル媒体の最初から行なわれるため処
理時間が長くなり、その分だけ再度途中終了する確率が
高くなるという欠点もある。また、従来の■の方法では
、書込み済のファイルB部分が無効ファイルとして残存
し、ファイル媒体の利用効率が低下するという欠点があ
る。
■ A method of erasing the entire file medium and rewriting from the first file A ■ A method of leaving the already written part of the file B as an invalid file and writing again from the beginning of the file B in the area after EOF [The invention aims to solve this problem] [Problems] However, with method (■) above, there is a waste of retrying the valid file part (file A).
Furthermore, since the retry is performed from the beginning of the file medium, the processing time becomes longer, and there is also the disadvantage that the probability that the process will be terminated midway again increases accordingly. Furthermore, the conventional method (2) has the drawback that the written portion of file B remains as an invalid file, reducing the efficiency of file medium usage.

本発明はこのような従来の問題点を解決したもので、そ
の目的は、無効ファイルを残すことな(然も高速に再試
行等し得るファイル書込み方式を提供することにある。
The present invention has solved these conventional problems, and its purpose is to provide a file writing method that does not leave invalid files (and can perform retries at high speed).

〔問題点を解決するための手段〕[Means for solving problems]

本発明は上記目的を達成するために、ファイル媒体に対
する一連のファイル書込み処理が正常終了した以外に何
等かの理由により途中終了した場合もEOFをファイル
媒体中の書込み終了した位置に記録するようにしたファ
イル書込み方式において、 一連の書込み処理が正常に終了した場合にその終了した
ファイル媒体中の位置を記録手段に記録するファイル終
了位置記録手段と、 書込み処理開始時に、ファイル媒体中に書込まれている
ファイルのうちどこまでが有効なファイルであるかを前
記記録手段に記録されたファイル終了位置から判別する
ファイル終了位置認識手段と、 書込み処理時に、前記ファイル終了位置認識手段で判別
された有効なファイルの直後から新しくファイルを書込
むファイル書込み制御手段とから構成される。
In order to achieve the above object, the present invention records an EOF at the position in the file medium where writing is completed even if a series of file writing processes to the file medium are terminated midway due to some reason other than normal termination. In the file writing method, the file end position recording means records the ending position in the file medium when a series of writing processes are normally completed; a file end position recognition means for determining from the file end position recorded in the recording means how far out of the file in the file is a valid file; It consists of a file write control means for writing a new file immediately after the file.

〔作用〕[Effect]

一連の書込み処理が正常に終了した場合、その終了した
ファイル媒体中の位置が記録手段に記録されるので、何
等かの理由により途中終了した場合でも、記録手段には
有効なファイルの最後の位置が記憶されていることにな
り、ファイル書込み制御手段はその直後から新しくファ
イルを書込むので、無効ファイルが残存することもなく
、また再試行の場合であってもファイル媒体の途中すな
わち有効なファイルの直後から書き始めることができる
When a series of writing processes is completed normally, the position in the file medium at which it ended is recorded in the recording means, so even if it ends midway for some reason, the recording means will still have the valid last position of the file. is stored, and the file write control means writes a new file immediately after that, so no invalid file remains, and even in the case of retrying, the file is stored in the middle of the file medium, i.e., a valid file. You can start writing immediately after.

〔実施例〕〔Example〕

第1図は本発明の一実施例のブロック図であり、1はフ
ァイル書込み制御手段、2はファイル終了位置認識手段
、3はファイル終了位置記録手段、4は記録手段、5は
利用者プログラム、6はファイル管理プログラム、7は
磁気ディスク等のファイル媒体、10は処理装置である
。また、第2図はファイル書込み制御手段1が行なう処
理の一例を示す流れ図である。
FIG. 1 is a block diagram of an embodiment of the present invention, in which 1 is a file write control means, 2 is a file end position recognition means, 3 is a file end position recording means, 4 is a recording means, 5 is a user program, 6 is a file management program, 7 is a file medium such as a magnetic disk, and 10 is a processing device. Further, FIG. 2 is a flowchart showing an example of the processing performed by the file write control means 1.

今、ファイル媒体7に例えば第3図(A)に示すように
Xの位置までファイルAが正常に記録されている場合を
想定すると、記録手段4にはファイル終了位置としてフ
ァイルAの最後の位置xが記録され、ファイル名として
Aが記録されている。
Now, assuming that the file A is normally recorded on the file medium 7 up to the position X as shown in FIG. x is recorded, and A is recorded as the file name.

このような状態で利用者プログラム5から別のファイル
Bの書込みが指示されたとすると、ファイル書込み制御
手段1は第2図に示すように、先ずファイル終了位置の
確認を行なう (Sl)。これは、ファイル終了位置認
識手段2を起動して記録手段4のファイル終了位置Xを
読取らせ、これを受取ることで行なわれる。
If the user program 5 instructs to write another file B in this state, the file write control means 1 first confirms the end position of the file, as shown in FIG. 2 (Sl). This is done by activating the file end position recognizing means 2 to read the file end position X of the recording means 4 and receiving it.

ファイル書込み制御手段1は、ファイル終了位置Xを確
認すると、次にファイル媒体7のそのファイル終了位置
XにEOFが記録されているか否かを判定する(B2)
。この場合、ファイルAは正常に書込みが完了したもの
としているので、ファイル終了位置XにEOFが記録さ
れており、ファイル書込み制御手段1はステップS3へ
進み、ファイル情報供給元(入側)からファイルBの最
初の−かたまりの情報(以下ブロックと称す)B1を入
力しくB3)、第3図(B)に示すようにEOFの位置
以降すなわちファイルへの直後に書込む(B5)、この
ようなブロックの読出し5書込み動作はファイル管理プ
ログラムの制御を借りて行なわれる。ファイル書込み制
御手段1は一つのブロックの書込みが終了すると、ファ
イルBの次のブロックB2の書込み、ブロックB3の書
込み等ファイルBを構成する全てのブロックB1〜Bn
について上記と同様にして書込みを行ない、第3図(C
)に示すように最後のブロックBnの書込みが完了する
と(S7)、その直後にEOFを記録しくB8)、記録
手段4にファイル終了位置としてファイルBの最後の位
置Zを記録すると共にファイル名としてBを記録する(
B9)。なお、ファイル終了位置およびファイル名の記
録は、ファイル終了位置記録手段3を起動し、このファ
イル終了位置記録手段3により行なわせる。
After confirming the file end position X, the file write control means 1 then determines whether EOF is recorded at the file end position X of the file medium 7 (B2).
. In this case, it is assumed that writing to file A has been completed normally, so EOF is recorded at the file end position Input the first block of information (hereinafter referred to as block) B1 of B (B3) and write it after the EOF position, that is, immediately after writing to the file (B5), as shown in Figure 3 (B). Block read and write operations are performed under the control of the file management program. When the writing of one block is completed, the file writing control means 1 writes the next block B2 of the file B, the writing of the block B3, etc.
Write in the same manner as above, and write in Figure 3 (C
), when the writing of the last block Bn is completed (S7), the EOF is recorded immediately after that (B8), and the last position Z of the file B is recorded in the recording means 4 as the file end position and as the file name. Record B (
B9). The file end position and file name are recorded by activating the file end position recording means 3.

以上はファイル情帳の書込みが最後まで正常に終了した
場合であるが、ファイルの書込み途中において、入側か
らのファイル情報の人力およびファイルの書込みにエラ
ーが発生したことが検出された場合(B4.B6)、第
3図(D)に示すようにエラー発生時点までに既に書込
まれたブロックBiの後ろにEOFを記録してファイル
の書込み処理を終了し1メツセージの送出等のエラー処
理を行なう (519)。
The above is a case where the writing of the file information book has completed successfully to the end, but when it is detected that an error has occurred in the manual input of the file information from the input side or in the writing of the file during the writing of the file (B4 .B6), as shown in Figure 3 (D), record EOF after the block Bi that has already been written up to the time of error occurrence, finish the file write process, and perform error processing such as sending one message. Do it (519).

さて、ファイル名Bの書込みが途中終了したことから、
再度そのファイルBの書込みが利用者プログラム5等か
ら指示されると、ファイル書込み制御手段1は第2図の
処理を再び開始する。この場合、記録手段4に記録され
たファイル終了位置はXのままとなっているので、ステ
ップS2ではNoと判別されることになり、正常終了時
とは異なりステップ310の処理が行なわれる。即ち、
先ずファイル書込み制御手段1はファイル書込みモード
を更新モードとする (310)、これは、VTOCフ
ァイル書込み制御ではファイル情報の保護の為、EOF
以前の領域への新たなファイル情報の書込みは更新モー
ドでなければ実行できないことに基づく。
Now, since writing of file name B has ended midway,
When the user program 5 etc. instructs to write the file B again, the file write control means 1 restarts the process shown in FIG. 2. In this case, since the file end position recorded in the recording means 4 remains at X, the determination in step S2 is No, and the process in step 310 is performed unlike when the process ends normally. That is,
First, the file write control means 1 sets the file write mode to the update mode (310). This is because in the VTOC file write control, the EOF
This is based on the fact that writing new file information to the previous area can only be executed in update mode.

ファイル書込み制御手段1は更新モードに設定すると、
次に入側からファイルBの最初のブロックBl’を入力
しく511) 、これを記録手段4に記録されているフ
ァイル終了位置すなわちXの位置に第3図(E)に示す
ように書込む(S13)。
When the file write control means 1 is set to update mode,
Next, input the first block Bl' of file B from the input side (511), and write it at the file end position recorded in the recording means 4, that is, the position X, as shown in FIG. 3(E). S13).

そして、ステップS12.  S14でそのブロック入
力および書込みにエラーが発生しなければファイルBが
終了していないことを確認しく318)、次のブロック
B2°以降の書込みを同様にして行なう。
Then, step S12. If no error occurs in the block input and writing in S14, it is confirmed that the file B has not ended (318), and the next block B2° and subsequent blocks are written in the same manner.

ブロックの書込みが第3図(E)に示すようにブロック
Bi゛まで行なわれ、次のブロックB ((−1の書込
みが行なわれると、EOF以降の領域に対し更新モード
で書込みが行なわれようとすることからステップS14
でエラーが発生する。ファイル書込み制御手段1は、こ
のエラーがEOF検出によるエラーであることを判別す
ると(S15)、アクセスモードを更新モードから拡張
モードに切換え(S16) 、第3図(F)に示すよう
にYの位置へブロックB 441゛ の再書込みを行な
った後(S17)、ブロックBn’ までの残りのブロ
ックを同じく拡張モードで書込む。そして、ファイルB
の書込みが終了すると、第3図(F)に示すようにその
直後にEOFを記録しく3B)、記録手段4にファイル
終了位置としてファイルBの最後の位置Zを記録すると
共にファイル名としてBを記録する (B9)。
As shown in FIG. 3(E), block writing is performed up to block Bi'', and the next block B (-1 is written, then writing is performed in the update mode to the area after EOF. Therefore, step S14
An error occurs. When the file write control means 1 determines that this error is an error caused by EOF detection (S15), it switches the access mode from the update mode to the expansion mode (S16), and writes Y as shown in FIG. 3(F). After rewriting block B 441' to the position (S17), the remaining blocks up to block Bn' are written in the same expanded mode. And file B
When the writing is completed, immediately after that, as shown in FIG. Record (B9).

以上はファイルBを再試行によって再度書込む場合の処
理であるが、第3図(D)の状態に別のファイルCを書
込む場合も同様に行なわれる。
The above is a process for writing file B again by retrying, but the same process is performed when writing another file C in the state shown in FIG. 3(D).

このように本実施例によれば、無効ファイルを残すこと
なく次のファイルの書込みが可能となり、再試行も有効
なファイルの直後から行なうことができる。また、ファ
イル書込み制御手段1はファイル媒体7上のX−Yの領
域とY−Zの領域すなわちEOFの前後の領域でファイ
ルアクセス方式を更新モードと拡張モードに自動的に切
換えることにより、利用者プログラムに対しては見かけ
上Xの位置からの単純な書込み処理として見せているの
で、利用者プログラムの変更なしに実施が可能となる。
As described above, according to this embodiment, it is possible to write the next file without leaving an invalid file, and retry can be performed immediately after the valid file. In addition, the file write control means 1 automatically switches the file access method between the update mode and expansion mode in the X-Y area and Y-Z area on the file medium 7, that is, the area before and after the EOF. Since the program appears to be a simple write process starting from position X, it can be implemented without changing the user program.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、一連の書込み処理が正
常終了したファイル媒体の位置を記録しておき、書込み
処理開始時に常にその書込み終了位置を確認しながらフ
ァイル情報の書込みを行なうので、ファイル書込み処理
の途中終了時の次の書込み処理において、ファイル媒体
中に無効な領域を残すことがなく、また書込み処理の途
中終了に対する再試行処理においてファイル媒体の途中
から再試行することができ、ファイル媒体への効率の良
い書込みが実現できる。
As explained above, the present invention records the position of the file medium where a series of write processes have successfully completed, and writes file information while always checking the write end position when starting the write process. In the next write process when the write process ends midway, no invalid area is left in the file medium, and in the retry process for the mid-way end of the write process, it is possible to retry from the middle of the file medium. Efficient writing to the medium can be achieved.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の一実施例のブロック図、第2図はファ
イル書込み制御手段1の処理例を示す流れ図、 第3図は本発明の実施例の動作説明図および、第4図は
従来のファイル書込み方式の説明図である。 1はファイル書込み制御手段、2はファイル終了位置P
!識手段、3はファイル終了位置記録手段、4は記録手
段、5は利用者プログラム、6はファイル管理プログラ
ム、7はファイル媒体、10は処理装置である。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flowchart showing an example of processing by the file write control means 1, FIG. 3 is an explanatory diagram of the operation of the embodiment of the present invention, and FIG. 4 is a conventional FIG. 2 is an explanatory diagram of a file writing method. 1 is the file write control means, 2 is the file end position P
! 3 is a file end position recording means, 4 is a recording means, 5 is a user program, 6 is a file management program, 7 is a file medium, and 10 is a processing device.

Claims (1)

【特許請求の範囲】 ファイル媒体に対する一連のファイル書込み処理が正常
終了した以外に何等かの理由により途中終了した場合も
エンド・オブ・ファイルをファイル媒体中の書込み終了
した位置に記録するようにしたファイル書込み方式にお
いて、 一連の書込み処理が正常に終了した場合にその終了した
ファイル媒体中の位置を記録手段に記録するファイル終
了位置記録手段と、 書込み処理開始時に、ファイル媒体中に書込まれている
ファイルのうちどこまでが有効なファイルであるかを前
記記録手段に記録されたファイル終了位置から判別する
ファイル終了位置認識手段と、 書込み処理時に、前記ファイル終了位置認識手段で判別
された有効なファイルの直後から新しくファイルを書込
むファイル書込み制御手段とを具備したことを特徴とす
るファイル書込み方式。
[Claims] Even if a series of file writing processes to a file medium are terminated midway due to some reason other than normal termination, the end of file is recorded at the position in the file medium at which writing is completed. In the file writing method, there is provided a file end position recording means for recording in a recording means the position in the file medium at which a series of writing processes has ended normally; file end position recognition means for determining from the file end position recorded in the recording means how far out of the existing file is a valid file; and a file end position recognition means determined by the file end position recognition means at the time of writing processing. A file writing method characterized by comprising a file writing control means for writing a new file immediately after.
JP61036169A 1986-02-20 1986-02-20 File writing system Granted JPS62192826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61036169A JPS62192826A (en) 1986-02-20 1986-02-20 File writing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61036169A JPS62192826A (en) 1986-02-20 1986-02-20 File writing system

Publications (2)

Publication Number Publication Date
JPS62192826A true JPS62192826A (en) 1987-08-24
JPH0451860B2 JPH0451860B2 (en) 1992-08-20

Family

ID=12462250

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61036169A Granted JPS62192826A (en) 1986-02-20 1986-02-20 File writing system

Country Status (1)

Country Link
JP (1) JPS62192826A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08185273A (en) * 1994-12-29 1996-07-16 Sharp Corp Isam file information processor
JP2006323632A (en) * 2005-05-19 2006-11-30 Pentax Corp Animation recording device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5794840A (en) * 1980-12-04 1982-06-12 Fuji Facom Corp Record storing system of file device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5794840A (en) * 1980-12-04 1982-06-12 Fuji Facom Corp Record storing system of file device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08185273A (en) * 1994-12-29 1996-07-16 Sharp Corp Isam file information processor
JP2006323632A (en) * 2005-05-19 2006-11-30 Pentax Corp Animation recording device
JP4679234B2 (en) * 2005-05-19 2011-04-27 Hoya株式会社 Movie recording device

Also Published As

Publication number Publication date
JPH0451860B2 (en) 1992-08-20

Similar Documents

Publication Publication Date Title
US7325112B2 (en) High-speed snapshot method
JPS62192826A (en) File writing system
JPH0475544B2 (en)
JPH027096B2 (en)
JPH04251347A (en) Disk file controller and updating method
JP2877973B2 (en) File recall control method
JPH10312329A (en) Data backup and restoring device
JPH06124214A (en) Continuation control system for fault hot job
JP2978803B2 (en) Communication error log collection method
JPH0793101A (en) Data backup device
JP3022011B2 (en) Data backup system
JPH0535414A (en) Magnetic tape file access system
JPH0820993B2 (en) Sequential file processing method
JPH043218A (en) Method and device for writing data
JPS6346553A (en) File copying method
JPH09218751A (en) Copy system to recording medium
JPH08263389A (en) Data backup method
JP2549155Y2 (en) Optical filing system
JPS6254347A (en) Processing system for fault of file
JPH0488413A (en) Input source selection type key input system
JPH0561755A (en) Sequential file processing system
JPS62221045A (en) File writing system
JPH0561741A (en) File writing system
JPH0635769A (en) Data base system
JPH0916335A (en) Data processor