JPH012133A - file management device - Google Patents

file management device

Info

Publication number
JPH012133A
JPH012133A JP62-158163A JP15816387A JPH012133A JP H012133 A JPH012133 A JP H012133A JP 15816387 A JP15816387 A JP 15816387A JP H012133 A JPH012133 A JP H012133A
Authority
JP
Japan
Prior art keywords
record
data
file
length
variable length
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.)
Pending
Application number
JP62-158163A
Other languages
Japanese (ja)
Other versions
JPS642133A (en
Inventor
正敬 阿部
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP62158163A priority Critical patent/JPS642133A/en
Priority claimed from JP62158163A external-priority patent/JPS642133A/en
Publication of JPH012133A publication Critical patent/JPH012133A/en
Publication of JPS642133A publication Critical patent/JPS642133A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、直接アクセス記憶装置におけるファイルの制
御方式に係り、特に順次編成ファイルの制御方式に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for controlling files in a direct access storage device, and particularly to a method for controlling sequentially organized files.

〔発明の概要〕[Summary of the invention]

ワードプロセッサにおける文書データファイルやエディ
タにより作成されるテキストファイルは、通常順次編成
ファイルである。文書データファイルやテキストファイ
ルは、データの変更が煩雑に行われるために、レコード
の追加、削除の回数が多い。しかし、順次編成ファイル
の場合レコードの追加や削除を行うためにはファイル全
体を書き直す必要があり、ワードプロセッサやエディタ
を作成する場合、そのためのプログラムを作成する必要
がある。このため、ワードプロセッサやエディタ等のプ
ログラム等の生産性が低いという問題があった。
Document data files in word processors and text files created by editors are typically sequentially organized files. Since data in document data files and text files is complicated to change, records are added and deleted many times. However, in the case of a sequentially organized file, it is necessary to rewrite the entire file in order to add or delete records, and when creating a word processor or editor, it is necessary to create a program for this purpose. Therefore, there has been a problem in that the productivity of programs such as word processors and editors is low.

本発明は、順次編成ファイルのレコードの伸長や短縮等
の変更を、アプリケーションプログラムにおいてレコー
ドのデータを修正するだけで行えるようにしたものであ
り、ワードプロセッサやエディタ等のプログラムの生産
性が向上する。
The present invention enables changes such as expansion and contraction of records in a sequential file by simply modifying record data in an application program, improving the productivity of programs such as word processors and editors.

〔従 来 の 技 術〕[Traditional techniques]

コンピュータを用いてデータ処理を行う場合、データの
種類に応じて最適なファイルを設計し、データの処理効
率を高める必要がある。ファイルは編成方式により順次
編成ファイル、直接編成ファイル、索引順次編成ファイ
ル、区分編成ファイル等に分類されるが、ワードプログ
ラムやエディタ等が取り扱う文書データやテキストデー
タは、データ量も大き(、データの更新の頻度も多いの
で通常順次編成ファイルに記憶している。順次編成ファ
イルは、磁気ディスクやフロンピーディスク等のボリュ
ーム上に大容量のデータを記憶する場合に向いている。
When processing data using a computer, it is necessary to design an optimal file according to the type of data to improve data processing efficiency. Files are classified into sequential organization files, direct organization files, indexed sequential organization files, segmented organization files, etc., depending on the organization method, but document data and text data handled by word programs and editors have a large amount of data (, Since it is frequently updated, it is usually stored in sequential files.Sequential files are suitable for storing large amounts of data on volumes such as magnetic disks and floppy disks.

第6図に、従来のファイル管理装置を適用したワードプ
ロセッサのシステム構成図を示す。CPU1lは、共通
バス12を介してメモリ13、コンソール制御装置14
、ディスク制御装置15とが接続されており、コンソー
ル制御装置14にはキーボード16、CRT17が、デ
ィスク制御装置には磁気ディスク18、フロッピーディ
スク19が接続されている。
FIG. 6 shows a system configuration diagram of a word processor to which a conventional file management device is applied. The CPU 1l is connected to a memory 13 and a console control device 14 via a common bus 12.
, and a disk controller 15 are connected to the console controller 14, and a keyboard 16 and a CRT 17 are connected to the console controller 14, and a magnetic disk 18 and a floppy disk 19 are connected to the disk controller.

ユーザーがキーボード16から、データを入力すると、
そのデータはコンソール制御装置14により、CRT1
7に表示されると共に、共通バスエ2を介してCPU1
1に送られる。CPUI 1は、そのデータを共通バス
12を介してメモリ13の所定領域へ書き込む。以上の
動作の繰り返しによりユーザーが、文書データをキーボ
ード16から全て入力し終ると、その文書データはメモ
リ13の所定領域に格納され、ユーザーがその入力した
文書データをファイルにセーブするためのコマンドをキ
ーボード16から入力すると、CPUIIの制御により
メモリ13から共通バス12を介してディスク制御装置
15へ文書データが転送され、ディスク制御装置により
前記コマンド入力の指定する記憶装置(磁気ディスク1
8またはフロッピーディスク19)に前記文書データが
書き込まれる(文書ファイルの作成)。
When the user enters data from the keyboard 16,
The data is transferred to the CRT1 by the console controller 14.
7 and is also displayed on the CPU 1 via the common bus 2.
Sent to 1. The CPU 1 writes the data to a predetermined area of the memory 13 via the common bus 12. When the user finishes inputting all document data from the keyboard 16 by repeating the above operations, the document data is stored in a predetermined area of the memory 13, and the user issues a command to save the input document data to a file. When input from the keyboard 16, document data is transferred from the memory 13 to the disk controller 15 via the common bus 12 under the control of the CPU II, and the disk controller transfers the document data to the storage device (magnetic disk 1) specified by the command input.
8 or floppy disk 19) (creation of a document file).

以上のようにして、ワードプロセッサにより作成される
文書ファイルは、CRT17上のスクリーンの1行に入
力されたテキストデータ(キャリフジ・リターンが入力
されるまで)をルコードとするファイルである。文書フ
ァイルは、修正される頻度が高く、またユーザーが1行
に入力するテキストデータのデータ長は各行毎に異なる
場合が多いので通常可変長レコードの順次編成ファイル
である。ユーザーは磁気ディスク18またはフロッピー
ディスク19にセーブした文書ファイルの内容を、キー
ボード16からの文書ファイル修正のコマンド等を入力
することによりCRT17に表示させ、修正することが
できる。文書ファイルの修正は、行の追加や行の削除、
各行のデータの修正等により行われる。順次編成ファイ
ルの場合、各レコードは磁気ディスク18やフロッピー
ディスク19上に連続して記憶されるので、文書ファイ
ルのデータの修正により、レコードの追加やレコードの
データ長が変更した場合、ファイル全体を書き換える処
理が行われる。
The document file created by the word processor as described above is a file whose code is the text data input in one line of the screen on the CRT 17 (until a carry-return is input). Document files are frequently modified and the data length of text data input by the user per line is often different for each line, so they are usually sequentially organized files with variable length records. The user can display and modify the contents of a document file saved on the magnetic disk 18 or floppy disk 19 by inputting a document file modification command from the keyboard 16 on the CRT 17. You can modify document files by adding lines, deleting lines,
This is done by modifying the data in each row. In the case of a sequentially organized file, each record is stored consecutively on the magnetic disk 18 or floppy disk 19, so if a record is added or the data length of a record is changed due to data modification of the document file, the entire file is A rewriting process is performed.

ところで、ファイル全体を書き換える処理は、処理時間
がかかるために、文書ファイルを固定長レコードの順次
編成ファイルとすることも考えられるが、その場合デー
タの修正により1行のデータ長が増加しても、変更のあ
ったレコードのみを書き換えるだけでよく、ファイル全
体の書き換えを行う必要がない。しかし、固定長レコー
ドとした場合、磁気ディスクやフロンピーディスク等の
記憶媒体の利用効率が低下する。
By the way, since the process of rewriting the entire file takes processing time, it is possible to make the document file into a sequential file with fixed-length records, but in that case, even if the data length of one line increases due to data modification, , it is only necessary to rewrite only the records that have changed; there is no need to rewrite the entire file. However, when fixed-length records are used, the utilization efficiency of storage media such as magnetic disks and floppy disks decreases.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述したように、従来のファイル管理装置では可変長レ
コードの順次編成ファイルでルコードのデータ長の変更
が生じた場合、アプリケーション・プログラムを実行し
てファイル全体の書き換えを行う処理を行う必要があっ
た。すなわち、ワードプロセッサやエディタ等のように
、文書データやテキストデータを可変長レコードの順次
編成ファイルに記憶し、そのファイルの各レコードに対
し変更を行うプログラムを作成する場合、レコード変更
のためのプログラムが複雑でステップ数も多くなるため
プログラムの作成に時間がかかり生産性が低くなるとい
う問題があった。
As mentioned above, with conventional file management devices, when the data length of a code changes in a sequential file with variable-length records, it is necessary to execute an application program to rewrite the entire file. . In other words, when creating a program such as a word processor or editor that stores document data or text data in a sequential file of variable-length records and makes changes to each record in that file, the program for changing records is There is a problem in that it is complex and requires a large number of steps, so it takes time to create a program, which reduces productivity.

本発明は、上記従来の問題点に鑑み、可変長レコードか
ら成る順次編成ファイルに対しレコード長の変更を伴う
レコードの書換処理を行うアプリケーション・プログラ
ムの生産性を高めるファイル管理装置を提供することを
目的とする。
In view of the above conventional problems, it is an object of the present invention to provide a file management device that increases the productivity of an application program that performs record rewriting processing that involves changing the record length for a sequentially organized file consisting of variable-length records. purpose.

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

第1図は、本発明の機能ブロック図である。 FIG. 1 is a functional block diagram of the present invention.

1は記憶媒体に記憶された制御情報とデータを含む可変
長レコードにより構成される順次編成ファイルから、書
き込み要求のあった可変長レコードを読み出すレコード
読み出し手段、2は該レコード読み出し手段1から読み
出された現可変長レコードと新たに書き込む新可変禰レ
コードのレコード長を比較する比較手段、3は該比較手
段2の比較結果が所定の結果である場合に(例えばレコ
ード長が一致あるいはレコード長が短い等)前記記憶媒
体上の前記現可変長レコードの制御情報とデータを書き
換える第1の作成手段、4は該比較手段2により前記新
可変長レコードが前記現可変長レコードよりもレコード
長が長いと判別された場合には、前記新可変長レコード
を前記記憶媒体    上の前記現可変長レコードを格
納する位置とは異なる位置に書き込み、前記記憶媒体上
の前記現可変長レコードの制御情報に前記新可変長レコ
ードの書き込み位置を書き込む第2の作成手段である。
Reference numeral 1 denotes a record reading means for reading out a variable length record for which a writing request has been made from a sequentially organized file composed of variable length records containing control information and data stored in a storage medium; 2, reading from the record reading means 1; Comparison means 3 compares the record lengths of the current variable-length record that has been written and the new variable-length record to be newly written; a first creation means for rewriting the control information and data of the current variable length record on the storage medium; 4, the comparison means 2 determines that the new variable length record is longer than the current variable length record; If it is determined that This is the second creation means for writing the writing position of the new variable length record.

〔作   用〕[For production]

今、アプリケーション・プログラムの実行により、順次
編成ファイルの可変長レコードの書き込み要求が入力さ
れたとすると、レコード読み出し手段1は記憶媒体上の
前記順次編成ファイルから例えば書き込み要求のあった
レコード番号に対応する現可変長レコードを読み出し比
較手段2に出力する。比較手段2は、前記現可変長レコ
ードとアプリケーション・プログラムが書き込みを要求
する新可変長レコードとのレコード長を比較し、比較結
果を第1の作成手段3及び第2の作成手段4に出力する
。第1の作成手段3は前記比較結果が所定の結果である
場合に、前記記憶媒体上の前記現可変長レコードの制御
情報とデータを書き換える。また、第2の作成手段4は
前記比較手段2から前記新可変長レコードが前記現可変
長レコードよりもレコード長が長い旨の判別結果を入力
した時は、前記新可変長レコードを前記記憶媒体上の前
記現可変長レコードを格納する位置とは異なる位置に書
き込み、その書き込み位置を前記記憶媒体上の前記現可
変長レコードの制御情報に書き込む。このため、新可変
長レコードのレコード長が伸長した場合にも、現可変長
レコードの制御情報に新可変長レコードの書き込み位置
をセントし、新可変長レコードをその書き込み位置に書
き込めばよいのでファイル全体の書換えを行う必要がな
(なる。
Now, if a request to write a variable length record of a sequentially organized file is input by executing an application program, the record reading means 1 reads the record number corresponding to the write request from the sequentially organized file on the storage medium. The current variable length record is read and output to the comparison means 2. The comparison means 2 compares the record lengths of the current variable length record and the new variable length record that the application program requests to write, and outputs the comparison results to the first creation means 3 and the second creation means 4. . The first creating means 3 rewrites the control information and data of the current variable length record on the storage medium when the comparison result is a predetermined result. Further, when the second creation means 4 receives a determination result from the comparison means 2 that the record length of the new variable length record is longer than the current variable length record, the second creation means 4 transfers the new variable length record to the storage medium. The above-mentioned current variable-length record is written to a different location from the location where the current variable-length record is stored, and the write location is written to the control information of the current variable-length record on the storage medium. Therefore, even if the record length of a new variable-length record is extended, the writing position of the new variable-length record can be set in the control information of the current variable-length record, and the new variable-length record can be written to that writing position. There is no need to rewrite the entire thing.

〔実  施  例〕〔Example〕

以下、図面を参照しながら本発明の実施例について説明
する。第2図は本発明の実施例を適用したシステムのブ
ロック構成図である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 2 is a block diagram of a system to which an embodiment of the present invention is applied.

CPU21は、RAM (不図示)等のメモリ23に格
納されたワードプロセッサやエディタ等のプログラムを
実行する中央処理装置(Cen tra IProce
ssing Unit )であり、共通バス22を介し
てメモリ23、メモリ24、コンソール制御装置25、
ディスク制御装置26と接続されている。
The CPU 21 is a central processing unit that executes programs such as word processors and editors stored in a memory 23 such as a RAM (not shown).
ssing Unit), and via the common bus 22, the memory 23, the memory 24, the console control device 25,
It is connected to the disk controller 26.

コンソール制御装置25は、キーボード28から入力す
るデータをエコーバックしてCRT27へ表示させると
共にコード変換して共通バス22を介してCPU21へ
出力させる。また、CPU21の制御によりメモリ23
から読み出されたデータを共通バス22を介し入力し、
CRT27へ表示させる等の制御を行う。ディスク制御
装置26は、CPU21から共通バス22を介して入力
する入出力制御命令により磁気ディスク29、フロッピ
ーディスク30へのデータの書き込み、また、データの
読み出し等の制御を行う。また、メモリ23はワードプ
ロセッサやエディタ等のプログラムを格納すると共に、
コンソール制御装置25、共通バス22を介し入力され
るキーボード28からの入力データを格納するメモリで
あり、さらにワードプロセッサやエディタの起動時に、
ユーザーがキーボード2日から入力した修正データ等が
格納される。また、ワードプロセッサやエディタの起動
により作成された文書ファイルやテキストファイルは、
ユーザーがキーボード28から文書ファイルやテキスト
ファイルをセーブするコマンド入力を行うことにより磁
気ディスク29またはフロッピーディスク30にセーブ
される。
The console control device 25 echoes back data input from the keyboard 28 and displays it on the CRT 27, converts the data, and outputs the code to the CPU 21 via the common bus 22. Also, under the control of the CPU 21, the memory 23
input the data read from the common bus 22,
Controls such as display on the CRT 27 are performed. The disk control device 26 controls writing of data to the magnetic disk 29 and floppy disk 30, reading of data, etc. based on input/output control commands inputted from the CPU 21 via the common bus 22. In addition, the memory 23 stores programs such as word processors and editors, and
This is a memory that stores input data from the keyboard 28 that is input via the console control device 25 and the common bus 22, and also when starting up a word processor or editor.
Correction data etc. entered by the user from the keyboard on the second day are stored. In addition, document files and text files created by starting a word processor or editor,
When the user inputs a command to save a document file or text file from the keyboard 28, the document file or text file is saved on the magnetic disk 29 or floppy disk 30.

さらに、ユーザがキーボード28から文書ファイルやテ
キストファイルのファイル修正等を指示するコマンドを
入力すると、CPU21の制御により磁気ディスク29
またはフロッピーディスク30からディスク制御装置2
6を介し該当ファイルが読み出されメモリ24へ格納さ
れる。そして、CPU21の制御により前記該当ファイ
ルは画面表示用のデータに編集されコンソール制御装置
25を介しCRT27にファイルの内容が表示される。
Further, when the user inputs a command from the keyboard 28 to instruct file modification of a document file or text file, the magnetic disk 29 is
Or from the floppy disk 30 to the disk controller 2
6, the corresponding file is read out and stored in the memory 24. Under the control of the CPU 21, the corresponding file is edited into data for screen display, and the contents of the file are displayed on the CRT 27 via the console control device 25.

次に、磁気ディスク29またはフロッピーディスク30
に格納される文書ファイルまたはテキストファイルの構
成を第3図(al、 (blに示す。同図(alに示す
ように、文書ファイルやテキストファイル等の可変長レ
コードから成る順次編成ファイル40は、可変長レコー
ド群41と変更レコードプール42から構成される。可
変長レコード群41内には、文書ファイルやテキストフ
ァイルのデータから成る可変長レコード43が連続した
領域に格納されそいる。可変長レコード43の詳しい構
成を第3図(b)に示す。可変長レコード43は、制御
情報43a、データ域43b、レコードエンドデリミツ
タ43Cから構成されており、データ域43bにはCR
T27上のスクリーンの1行に表示される文書データや
テキストデータが記憶され、そのデータ長は最初に書き
込まれた時のデータ長に等しい。また、可変長レコード
43の最後尾には可変長レコード43の終了を示す所定
コードのレコードエンドデリミツタ43Cが書かれる。
Next, the magnetic disk 29 or floppy disk 30
The structure of the document file or text file stored in the is shown in FIG. 3 (al, (bl). As shown in FIG. It is composed of a variable length record group 41 and a changed record pool 42. Within the variable length record group 41, variable length records 43 consisting of data of document files and text files are stored in a continuous area.Variable length records 43 is shown in FIG. 3(b).The variable length record 43 is composed of control information 43a, a data area 43b, and a record end delimiter 43C.
Document data or text data displayed on one line of the screen on T27 is stored, and the data length is equal to the data length when first written. Further, at the end of the variable length record 43, a record end delimiter 43C of a predetermined code indicating the end of the variable length record 43 is written.

制御情報43aは、可変長レコード43の有効データが
データ域43bに格納されたデータに等しいか否かを示
す変更無フラグ44、レコードの修正によりデータが短
縮された場合にデータ域43b内の有効データの先頭ア
ドレスからのデータ長(文字数)を示す有効データ長4
5、レコードの修正によりデータがデータ域43b内に
格納しきれなくなった場合に、その修正データが書き込
まれた変更レコードプール42内のアドレスを示すポイ
ンタ46から成っている。尚、変更無フラグ44には可
変長レコード43のデータがデータ域43b内に格納さ
れたデータに等しい場合には“0”、可変長レコード4
3のデータがデータ域43b内の一部に格納されている
場合には“1”(短縮)、可変長レコード43のデータ
が変更レコードプール42内の可変長レコード43に格
納されている場合には2” (伸長)が書き込まれる。
The control information 43a includes an unchanged flag 44 that indicates whether the valid data of the variable-length record 43 is equal to the data stored in the data area 43b, and a no-change flag 44 that indicates whether the valid data of the variable-length record 43 is equal to the data stored in the data area 43b; Effective data length 4 indicating the data length (number of characters) from the start address of the data
5. It consists of a pointer 46 that indicates the address in the changed record pool 42 where the modified data is written when the data cannot be stored in the data area 43b due to record modification. Note that the no-change flag 44 is set to "0" when the data of the variable-length record 43 is equal to the data stored in the data area 43b;
3 is stored in a part of the data area 43b, it is “1” (shortened), and when the data of the variable length record 43 is stored in the variable length record 43 in the changed record pool 42, it is “1” (shortened). 2” (expansion) is written.

従って、有効データ長45は、変更無フラグが“1”の
場合のみ有効となり、ポインタ46は、変更無フラグが
2”の場合のみ有効となる。磁気ディスク29またはフ
ロッピーディスク30内に格納された文書ファイルやテ
キストファイル等の順次編成ファイル40内のデータは
ファイル修正時にはディスク制御装置26を介し読み出
され、メモリ24に格納される。また、可変長レコード
43の編集もメモリ24上で行なわれ、制御情報43a
の設定、データ域43bへのデータ書き込み等が終了す
ると、メモリ24上の可変長レコード43はディスク制
御装置26を介し磁気ディスク29またはフロッピーデ
ィスク30の該当ファイルの所定位置に書き込まれる。
Therefore, the effective data length 45 is valid only when the no-change flag is "1", and the pointer 46 is valid only when the no-change flag is "2". Data in the sequentially organized file 40 such as a document file or a text file is read out via the disk controller 26 and stored in the memory 24 when modifying the file. Editing of the variable length record 43 is also performed in the memory 24. , control information 43a
When the settings, writing of data to the data area 43b, etc. are completed, the variable length record 43 on the memory 24 is written to a predetermined position of the corresponding file on the magnetic disk 29 or floppy disk 30 via the disk controller 26.

次に、以上のように構成された本実施例の動作を説明す
る。
Next, the operation of this embodiment configured as above will be explained.

まず、順次編成ファイル40へのデータ書き込みの動作
を第4図のフローチャートを参照しながら説明する。
First, the operation of writing data into the sequential organization file 40 will be explained with reference to the flowchart shown in FIG.

同図は、アプリケーション・プログラムが順次編成ファ
イル40に対しルコードの書き込みを行う命令を行った
時に、CPU21の制御により行なわれるレコードの書
き込みの動作を示すフローチャートである。アプリケー
ション・プログラムが、レコードの書き込みを行う場合
には、ファイル名、レコード番号、書き込むレコードの
データをパラメータとするレコード書き込み命令を行う
。上記アプリケーション・プログラムの実行時にCPU
21はレコード書き込み命令を読み出すと、まず、アプ
リケーション・プログラムが書き込みを要求するレコー
ド(現レコード)を、ディスク制御装置26を介し磁気
ディスク29またはフロッピーディスク30上の該当フ
ァイルから読み出し、メモリ24に格納する(処理5T
I)。
This figure is a flowchart showing the record writing operation performed under the control of the CPU 21 when the application program issues an instruction to write a record to the sequential organization file 40. When an application program writes a record, it issues a record write command using the file name, record number, and data of the record to be written as parameters. When the above application program is executed, the CPU
When 21 reads a record write command, it first reads the record (current record) requested to be written by the application program from the corresponding file on the magnetic disk 29 or floppy disk 30 via the disk controller 26 and stores it in the memory 24. (Processing 5T
I).

そして、その読み出したレコードのデータ長を計数する
(処理5TI)。
Then, the data length of the read record is counted (processing 5TI).

次に、メモリ23に格納されている新たに書き込むレコ
ードのデータをメモリ24の所定領域に転送し、さらに
その転送したデータの先頭に第3図(b)に示すような
制御情報43aを書き込む領域を設定すると共にデータ
の最後にレコードエンドデリミツタ43Cを書き込んで
可変長レコードを作成する(処理5T2)。
Next, data of a new record stored in the memory 23 to be written is transferred to a predetermined area of the memory 24, and further, an area where control information 43a as shown in FIG. 3(b) is written at the beginning of the transferred data. is set, and a record end delimiter 43C is written at the end of the data to create a variable length record (processing 5T2).

次に、上述のようにしてメモリ24に作成した新たに書
き込むレコードのデータ長を計数し、前記処理STIで
計数したレコードのデータ長と比較する(処理5T3)
。そして、比較の結果データ長が一致すれば、ディスク
制御装置26を介し磁気ディスク29またはフロッピー
ディスク30上の当該ファイルの現レコードの書かれた
位置にメモリ24上の新レコードを上書きする(処理5
74)。
Next, the data length of the newly written record created in the memory 24 as described above is counted and compared with the data length of the record counted in the process STI (process 5T3).
. If the data lengths match as a result of the comparison, a new record on the memory 24 is overwritten via the disk controller 26 at the position where the current record of the file is written on the magnetic disk 29 or floppy disk 30 (processing 5).
74).

一方、データ長の比較の結果、新レコードのデータ長が
短ければ、メモリ24上の新レコードの制御情報43a
の変更無フラグ44にレコードの短縮を示す“1”をセ
ットし、さらに新レコードのデータ長を有効データ長4
5にセットする(処理5T5)。そして、前記処理ST
4と同様にメモリ24上の新レコードをディスク制御装
置26を介し磁気ディスク29またはフロッピーディス
ク30上の当該ファイルの現レコードの書かれた位置に
上書きする(処理5T5)。
On the other hand, as a result of the data length comparison, if the data length of the new record is short, the control information 43a of the new record on the memory 24
The no-change flag 44 is set to "1" indicating that the record is shortened, and the data length of the new record is set to the effective data length 4.
5 (processing 5T5). Then, the processing ST
4, a new record on the memory 24 is overwritten via the disk controller 26 at the position of the current record of the file on the magnetic disk 29 or floppy disk 30 (process 5T5).

また、新レコードの方が現レコードよりも、データ長が
長ければ、メモリ24上の新レコードの制御情報43a
の変更無フラグ44にレコードの伸長を示す“2”をセ
ントし、変更レコードブール42の空き領域の先頭位置
をポインタ46にセットする(処理5T6)。そして、
新レコードの制御情報43aのみをディスク制御装置2
6を介し、磁気ディスク29またはフロッピーディスク
30上の当該ファイルの現レコードの制御情報43aに
上書きする(処理 5T6)。そして、新レコードの制
御情報43aのポインタ46にセットされた変更レコー
ドプール42の位置に、新レコードを書き込む(処理5
T7)。
Further, if the data length of the new record is longer than the current record, control information 43a of the new record on the memory 24
"2" indicating expansion of the record is set in the no-change flag 44, and the start position of the empty area of the changed record boolean 42 is set in the pointer 46 (processing 5T6). and,
Only the control information 43a of the new record is sent to the disk controller 2.
6, the control information 43a of the current record of the file on the magnetic disk 29 or floppy disk 30 is overwritten (process 5T6). Then, the new record is written to the position in the changed record pool 42 set in the pointer 46 of the new record control information 43a (processing 5
T7).

このように、アプリケーション・プログラムはレコード
のデータをセットした後、ファイル名、書き換えるレコ
ードの番号、書き込む新データを指定して、レコード書
き込み命令を行うだけで、可変長レコードの順次編成フ
ァイルにおいてレコード長の異なるレコードの書き換え
を行うことができる。このためファイルの途中にデータ
を追加する場合にも、ファイル全体を書き換える処理を
行なう必要はない。
In this way, the application program can set the record data, specify the file name, the record number to be rewritten, and the new data to be written, and simply issue a record write command. It is possible to rewrite different records. Therefore, even when data is added in the middle of a file, there is no need to rewrite the entire file.

次に、アプリケーション・プログラムが順次編成ファイ
ル40のレコード読み出し命令を行った場合に、CPU
21の制御により行われるレコード読み出しの動作を第
5図のフローチャートにより説明する。アプリケーショ
ン・プログラムは、レコードの読み出しを行う場合には
ファイル名、レコード番号及び読み出したレコードが転
送されるメモリ23のデータ入力領域を指定してレコー
ド読み出し命令を行う。
Next, when the application program issues a record read command of the sequential file 40, the CPU
The record reading operation performed under the control of 21 will be explained with reference to the flowchart of FIG. When reading a record, the application program specifies the file name, record number, and data input area of the memory 23 to which the read record is to be transferred, and issues a record read command.

CPU21は、レコード読み出し命令を解読すると、デ
ィスク制御装置26を介し磁気ディスク29またはフロ
ッピーディスク30上の該当ファイルから指定レコード
を読み出し、メモリ24へ格納する(処理5UI)。
When the CPU 21 decodes the record read command, the CPU 21 reads the designated record from the corresponding file on the magnetic disk 29 or floppy disk 30 via the disk controller 26, and stores it in the memory 24 (processing 5UI).

次に、読み出したレコードの制御情報43aの変更無フ
ラグ44の値を判別分岐しく処理5U2)、“0″が記
憶されていればメモリ24上に読み出7一 したレコードのデータ域43bに格納された全データを
メモリ23の前記データ入力領域へ転送する(処理5U
3)。
Next, the value of the no-change flag 44 of the control information 43a of the read record is determined and branched processing is performed 5U2), and if "0" is stored, it is read out on the memory 24 and stored in the data area 43b of the read record. Transfer all the data to the data input area of the memory 23 (processing 5U)
3).

一方、変更無フラグ44に1”が記憶されていれば、制
御情報43aのデータ域43bから有効データ長45に
記憶されているデータ長の有効データを読み出し、メモ
リ23上の前記データ入力領域へ転送する(処理5U4
)。また、制御情報43aの変更無フラグ44に“2″
が記憶されていれば、ディスク制御装置26を介しポイ
ンタ46の示す変更レコードプール42内の位置から可
変長レコード(変更レコード)43を読み出し、メモリ
24へ転送する(処理5U5)。そして、メモリ24上
へ読み出したレコードのデータ域43bに書かれたデー
タをメモリ23上の前記データ入力領域に転送する(処
理5U6)。
On the other hand, if 1'' is stored in the no-change flag 44, the valid data of the data length stored in the valid data length 45 is read from the data area 43b of the control information 43a and sent to the data input area on the memory 23. Transfer (processing 5U4
). Also, “2” is set in the no-change flag 44 of the control information 43a.
If stored, the variable length record (change record) 43 is read from the position in the change record pool 42 indicated by the pointer 46 via the disk controller 26 and transferred to the memory 24 (processing 5U5). Then, the data written in the data area 43b of the record read onto the memory 24 is transferred to the data input area on the memory 23 (processing 5U6).

尚、本実施例では変更レコードプールを同一の順次編成
ファイル内に配置したが、別のファイルとしてもよい。
In this embodiment, the changed record pool is placed in the same sequential file, but it may be placed in a separate file.

また、書き換える可変長レコードのデータ長が伸長した
場合、可変長レコード群に一部のデータを害き込み、書
ききれなかったデータのみを変更レコードプールに書く
ようにすれば更に磁気ディスクやフロッピィディスク等
の外部記憶装置の記憶空間の利用効率が向上する。
Additionally, if the data length of the variable-length record to be rewritten increases, some data can be corrupted into the variable-length record group, and only the data that could not be written can be written to the changed record pool. The utilization efficiency of the storage space of external storage devices such as the above is improved.

本発明は、エディタやワープロ以外にも事務処理を行う
コンピュータにも組み込むと、可変長レコードの順次編
成ファイルの処理を行うプログラム作成が容易になるの
でアプリケーション・プログラムの生産性が向上する。
When the present invention is incorporated into a computer that performs office processing in addition to an editor or a word processor, the productivity of the application program is improved because it becomes easier to create a program that processes a sequentially organized file with variable-length records.

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

以上、詳細に説明したように本発明によれば可変長レコ
ードの順次編成ファイルに対するレコードの書き換えを
アプリケーション・プログラム等がレコードの書き込み
命令を行うだけでできるようになるので、従来のように
アプリケーション・プログラムでプログラム全体を書き
換える処理を行う必要がなくなり、可変長レコードの順
次編成ファイルのデータ処理を行うアプリケーション・
プログラムの生産性が向上する。
As described in detail above, according to the present invention, records can be rewritten in a sequentially organized variable-length record file simply by an application program, etc. issuing a record write command. It is no longer necessary for the program to rewrite the entire program, and applications that process data in sequential files with variable-length records can
Improves program productivity.

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

第1図は、本発明の機能ブロック図、 第2図は、本発明の一実施例を適用したシステムのブロ
ック図、 第3図(alは、可変長レコードの順次編成ファイルの
構成図、 第3図(b)は、可変長レコードの構成図、第4図は、
本実施例のレコード書き換えの動作を説明するフローチ
ャート、 第5図は、本実施例のレコード読み出しの動作を説明す
るフローチャート、 第6図は、従来のファイル管理装置を通用したワードプ
ロセッサのシステム構成図である。 1・′・・レコード読み出し手段、 2・・・比較手段、 3・・・第1の作成手段、 4・・・第2の作成手段。 特許出願人   カシオ計算機株式会社第1図 グ (a) (b) 第3図 第4図
FIG. 1 is a functional block diagram of the present invention. FIG. 2 is a block diagram of a system to which an embodiment of the present invention is applied. Figure 3(b) is a configuration diagram of a variable length record, and Figure 4 is:
FIG. 5 is a flowchart explaining the record rewriting operation of this embodiment. FIG. 6 is a system configuration diagram of a word processor using a conventional file management device. be. 1.' Record reading means, 2. Comparison means, 3. First creation means, 4. Second creation means. Patent applicant: Casio Computer Co., Ltd. Figure 1 (a) (b) Figure 3 Figure 4

Claims (1)

【特許請求の範囲】 記憶媒体上にファイルを形成し、そのファイルにデータ
の書き込みやデータの読み出しを行うファイル管理装置
において、 前記記憶媒体上に記憶された制御情報とデータを含む可
変長レコードにより構成される順次編成ファイルから、
書き込み要求のあった可変長レコードを読み出すレコー
ド読み出し手段と、 該レコード読み出し手段から読み出された現可変長レコ
ードと新たに書き込む新可変長レコードのレコード長を
比較する比較手段と、 該比較手段の比較結果が所定の結果である場合に前記記
憶媒体上の前記現可変長レコードの制御情報とデータを
書き換える第1の作成手段と、該比較手段により前記新
可変長レコードが前記現可変長レコードよりもレコード
長が長いと判別された場合には、前記新可変長レコード
を前記記憶媒体上の前記現可変長レコードを格納する位
置とは異なる位置に書き込み、前記記憶媒体上の前記現
可変長レコードの制御情報に前記新可変長レコードの書
き込み位置を書き込む第2の作成手段とを有することを
特徴とするファイル管理装置。
[Claims] In a file management device that forms a file on a storage medium and writes data to and reads data from the file, a variable length record containing control information and data stored on the storage medium is provided. From the sequential file composed of
record reading means for reading a variable length record for which a write request has been made; comparing means for comparing the record length of the current variable length record read from the record reading means and a new variable length record to be newly written; a first creation means for rewriting control information and data of the current variable length record on the storage medium when the comparison result is a predetermined result; and a first creation means for rewriting the control information and data of the current variable length record on the storage medium; If it is determined that the record length is long, the new variable-length record is written to a location on the storage medium that is different from the location where the current variable-length record is stored, and the new variable-length record is a second creation means for writing the writing position of the new variable length record into the control information of the file management device.
JP62158163A 1987-06-25 1987-06-25 File control device Pending JPS642133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62158163A JPS642133A (en) 1987-06-25 1987-06-25 File control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62158163A JPS642133A (en) 1987-06-25 1987-06-25 File control device

Publications (2)

Publication Number Publication Date
JPH012133A true JPH012133A (en) 1989-01-06
JPS642133A JPS642133A (en) 1989-01-06

Family

ID=15665645

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62158163A Pending JPS642133A (en) 1987-06-25 1987-06-25 File control device

Country Status (1)

Country Link
JP (1) JPS642133A (en)

Similar Documents

Publication Publication Date Title
CA2047696C (en) Method of reading and writing files on non-erasable storage media
US4827447A (en) Method for selectively returning to the beginning or the previous revision point in document edition
US5293618A (en) Method for controlling access to a shared file and apparatus therefor
JPH02148235A (en) Data drawback system
JPS6019251A (en) Document switch control system for document processing system
JP3169596B2 (en) Database management device
JPS62264329A (en) Screen text editor processing system
JP3022011B2 (en) Data backup system
JPH02151944A (en) data processing equipment
JPH0239225A (en) Filing system
JP3056566B2 (en) FIFO table memory and control method therefor
WO1999015969A1 (en) File system block sub-allocator
JP2641399B2 (en) File management device
JPH0375942A (en) Editing history control system for file
JPH05151037A (en) Reorganization processing system for database in business processing
JPH01255028A (en) How to access external storage devices
JPH0644116A (en) Disk file saving control system
JPH05324734A (en) Electronic filing device
JPH0317727A (en) Record input/output control system
JPH02257282A (en) Table preparation processor
JPH02250166A (en) information processing equipment
JPH01137343A (en) File back-up system
JPH09282202A (en) Data movement management system
JPS6130299B2 (en)
JPH06149647A (en) Multi-media file managing system