kprolog K-Prolog Compiler Version 6.0

バイトの入出力

この節では、入出力ストリームからバイト単位に 読み書きする方法を解説します。
get_byte(@Stream_or_alias,?Byte)
Stream_or_aliasストリーム項または別名
Byteバイト
get_byte(?Byte)
Byteバイト

get_byte/2は、入力ストリームStream_or_aliasから1バイト読み取り、 整数としてByteと単一化します。
get_byte/1は、現在のファイル入力から読み取ります。

エラー
instantiation_error
type_error
domain_error
permission_error(input,stream,Stream_or_alias)Stream_or_aliasは出力ストリームです
permission_error(input,text_stream,Stream_or_alias)Stream_or_aliasはテキストストリームです
permission_error(input,past_end_of_stream,Stream_or_alias)ストリーム終端を越えて読み取ろうとしました


peek_byte(@Stream_or_alias,?Byte)
Stream_or_aliasストリーム項または別名
Byteバイト
peek_byte(?Byte)
Byteバイト

peek_byte/2は、入力ストリームStream_or_aliasから1バイト読み取り、 整数としてBiteと単一化します。その際に入力ストリームの ストリーム位置を変えません。
peek_byte/1は、現在のファイル入力から読み取ります。

エラー
instantiation_error
type_error
domain_error
permission_error(input,stream,Stream_or_alias)Stream_or_aliasは出力ストリームです
permission_error(input,text_stream,Stream_or_alias)Stream_or_aliasはテキストバイナリストリームです
permission_error(input,past_end_of_stream,Stream_or_alias)ストリーム終端を越えて読み取ろうとしました


put_byte(@Stream_or_alias,+Byte)
Stream_or_aliasストリーム項または別名
Byteバイト
put_byte(+Byte)
Byteバイト

put_byte/2は、出力ストリームStream_or_aliasに1バイト書き出します。
put_byte/1は、現在のファイルに書き出します。

エラー
instantiation_error
type_error
domain_error
permission_error(output,stream,Stream_or_alias)Stream_or_aliasは入力ストリームです
permission_error(output,text_stream,Stream_or_alias)Stream_or_aliasはテキストストリームです



一つ上に戻る 組込み述語に戻る 目次に戻る