Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.2 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Files : Input/Output functions > meof

meof

ファイルの終端に達したかどうかを確認する

呼び出し手順

err=meof(fd)

引数

fd

スカラー: 関数mopenにより返された fdパラメータ. -1 は直近にオープンされたファイルを意味します. デフォルト値は -1です.

err

スカラー: エラーインジケータ

説明

関数meofは,前の mget または mgetstr のコールにより ファイル終端に達している場合にヌル以外の値を返します. エラーフラグおよびEOFフラグをゼロにリセットするために, 関数mclearerrが使用されます.

// Write a temporary file with some text in it
this_file = pathconvert(TMPDIR+"/mputstr.txt", %F);

fd = mopen(this_file, "wt");
mputstr("Scilab is a numerical computing software.", fd);
mclose(fd);

fd = mopen(this_file,'rt');
i = 0;
while ~meof(fd) do
   mfscanf(1, fd, "%c");
   i = i + 1;
end

mclose(fd);

disp("Scilab has found " + string(i) + " chars in the file");

参照

  • mclose — オープンされているファイルを閉じる
  • meof — ファイルの終端に達したかどうかを確認する
  • mfprintf — 変換,整形し,ファイルにデータを書き込む
  • fprintfMat — 行列をファイルに書き込む
  • mfscanf — 標準入力から入力を読み込む (C言語の scanf 関数へのインターフェイス)
  • fscanfMat — テキストファイルから行列を読み込む
  • mget — 指定したバイナリ形式で バイトまたはワードを読み込み, double に変換
  • mgetstr — ファイルから文字列を読み込む
  • mopen — ファイルをオープン
  • mprintf — 変換, 整形し, Scilab主ウインドウにデータを書き込む
  • mput — 指定したバイナリ形式でバイトまたはワードを書き込む
  • mputstr — ファイルに文字列を書き込む
  • mscanf
  • mseek — バイナリファイルの中でカレントの位置を設定する.
  • mtell — ファイル先頭基準でカレントバイトのオフセットを返す
  • mdelete — ファイルを削除
Report an issue
<< mdelete Files : Input/Output functions merror >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:25:03 CEST 2015