226件ヒット
[101-200件を表示]
(0.088秒)
別のキーワード
ライブラリ
- ビルトイン (226)
キーワード
- clone (12)
-
close
_ read (12) -
close
_ write (12) - dup (12)
-
each
_ byte (24) -
each
_ codepoint (24) - fcntl (12)
-
internal
_ encoding (12) - pos (12)
- pos= (12)
- pread (8)
- pwrite (8)
- readbyte (12)
-
set
_ encoding _ by _ bom (6) - stat (12)
- syswrite (12)
- tell (12)
検索結果
先頭5件
-
IO
# each _ byte -> Enumerator (26.0) -
IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。
...
IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。
ブロックが与えられなかった場合は、自身から生成した
Enumerator オブジェクトを返します。
バイナリ読み込みメソッドとして動......作します。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "aあ")
File.open("testfile") do |io|
io.each_byte { |x| p x }
# => 97
# 227
# 129
# 130
end
//}... -
IO
# each _ byte {|ch| . . . } -> self (26.0) -
IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。
...
IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。
ブロックが与えられなかった場合は、自身から生成した
Enumerator オブジェクトを返します。
バイナリ読み込みメソッドとして動......作します。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "aあ")
File.open("testfile") do |io|
io.each_byte { |x| p x }
# => 97
# 227
# 129
# 130
end
//}... -
IO
# each _ codepoint -> Enumerator (26.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...
IO の各コードポイントに対して繰り返しブロックを呼びだします。
ブロックの引数にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde......あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
IO
# each _ codepoint {|c| . . . } -> self (26.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...
IO の各コードポイントに対して繰り返しブロックを呼びだします。
ブロックの引数にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde......あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
IO
# fcntl(cmd , arg = 0) -> Integer (26.0) -
IOに対してシステムコール fcntl を実行します。 機能の詳細は fcntl(2) を参照してください。 fcntl(2) が返した整数を返します。
...
IOに対してシステムコール fcntl を実行します。
機能の詳細は fcntl(2) を参照してください。
fcntl(2) が返した整数を返します。
@param cmd IO に対するコマンドを、添付ライブラリ fcntl が提供している定数で指定します。
@param......す。
@raise Errno::EXXX fcntl の実行に失敗した場合に発生します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
require "fcntl"
IO.write("testfile", "abcde")
# ファイル状態フラグを読み出す
File.open("testfile") do |f|......f.fcntl(Fcntl::F_GETFL, 0) # => 0
f.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) # => 0
f.fcntl(Fcntl::F_GETFL, 0) # => 4
end
//}... -
IO
# internal _ encoding -> Encoding | nil (26.0) -
IO の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...
IO の内部エンコーディングを返します。
内部エンコーディングが指定されていない場合は nil を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde")
File.open("testfile") do |f|
p f.internal_encoding # => nil
f.set_encoding("ASCII-8BIT", "EUC-JP"......)
p f.internal_encoding # => #<Encoding:EUC-JP>
end
//}... -
IO
# pos -> Integer (26.0) -
ファイルポインタの現在の位置を整数で返します。
...タの現在の位置を整数で返します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\n")
File.open("testfile") do |f|
f.pos # => 0
f.gets # => "This is line one\n"
f.pos # => 17
end
//}... -
IO
# pos=(n) (26.0) -
ファイルポインタを指定位置に移動します。 IO#seek(n, IO::SEEK_SET) と同じです。
...タを指定位置に移動します。
IO#seek(n, IO::SEEK_SET) と同じです。
@param n 先頭からのオフセットを整数で指定します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is lin......e two\n")
File.open("testfile") do |f|
f.pos # => 0
f.pos = 17
f.gets # => "This is line two\n"
end
//}... -
IO
# pread(maxlen , offset , outbuf = "") -> string (26.0) -
preadシステムコールを使ってファイルポインタを変更せずに、また現在のファイルポインタに 依存せずにmaxlenバイト読み込みます。
...みます。
IO#seekとIO#readの組み合わせと比べて、アトミックな操作に
なるという点が優れていて、複数スレッド/プロセスから同じIOオブジェクトを
様々な位置から読み込むことを許します。
どのユーザー空間のIO層のバッフ......ない OS で発生します。
//emlist[例][ruby]{
File.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
p f.read # => "This is line one\nThis is line two\n"
p f.pread(12, 0) # => "This is line"
p f.pread(9, 8) # => "line one\n"
end
//}...