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

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 help >> Files : Input/Output functions > mgetstr

mgetstr

文字列を読み込む

呼び出し手順

str=mgetstr(n [,fd] )

パラメータ

n

正のスカラー: 読み込む文字数.

fd

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

str

文字列

説明

mgetstr 関数により バイナリファイルの文字列を読み込むことができます. 読み込みが完了する前にEOFに達した場合,適切に読み込まれた値のみが 返されます.

// テキスト読み込みモードでファイル記述子をオープン
fd_r = mopen(SCI+'/ACKNOWLEDGEMENTS','rt')

// fd_rから100文字を取得
strs_1 = mgetstr(100, fd_r)

// fd_rから次の200文字を取得
strs_2 = mgetstr(200, fd_r)

// ファイル記述子を閉じる
mclose(fd_r);

参照

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

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 Oct 05 12:12:55 CEST 2011