2020件ヒット
[1-100件を表示]
(0.053秒)
別のキーワード
種類
- インスタンスメソッド (1408)
- 特異メソッド (552)
- 定数 (60)
ライブラリ
- ビルトイン (1708)
- etc (12)
- expect (24)
-
io
/ console (144) -
io
/ console / size (24) -
io
/ nonblock (24) -
io
/ wait (72) - scanf (12)
キーワード
- << (12)
-
SEEK
_ CUR (12) -
SEEK
_ DATA (12) -
SEEK
_ END (12) -
SEEK
_ HOLE (12) -
SEEK
_ SET (12) - advise (12)
- autoclose? (12)
- binmode (12)
- binmode? (12)
- binread (12)
- binwrite (12)
- bytes (14)
- chars (14)
- clone (12)
- close (12)
-
close
_ on _ exec? (12) -
close
_ read (12) -
close
_ write (12) - closed? (12)
- codepoints (14)
- console (12)
-
console
_ size (12) - cooked (12)
- cooked! (12)
-
copy
_ stream (24) -
default
_ console _ size (12) - dup (12)
- each (72)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ line (72) - echo? (12)
- eof (12)
- eof? (12)
- expect (24)
-
external
_ encoding (12) - fcntl (12)
- fdatasync (12)
- fileno (12)
- flush (12)
-
for
_ fd (12) - foreach (24)
- fsync (12)
- getbyte (12)
- getc (12)
- getch (12)
- gets (36)
- iflush (12)
-
internal
_ encoding (12) - ioctl (12)
- ioflush (12)
- isatty (12)
- lineno (12)
- lines (42)
- new (12)
- noecho (12)
- nonblock (12)
- nonblock? (12)
- nread (12)
- oflush (12)
- open (24)
- path (3)
- pathconf (12)
- pid (12)
- pipe (96)
- popen (168)
- pos (12)
- pread (8)
- print (12)
- printf (12)
- putc (12)
- puts (12)
- pwrite (8)
- raw (12)
- raw! (12)
- read (48)
-
read
_ nonblock (12) - readbyte (12)
- readchar (12)
- readline (36)
- readlines (72)
- readpartial (12)
- ready? (12)
- reopen (36)
- rewind (12)
- scanf (12)
- seek (12)
- select (12)
-
set
_ encoding (36) -
set
_ encoding _ by _ bom (6) - stat (12)
- sync (12)
- sysopen (12)
- sysread (12)
- sysseek (12)
- syswrite (12)
- tell (12)
-
to
_ i (12) -
to
_ io (12) -
to
_ path (3) -
try
_ convert (12) - tty? (12)
- ungetbyte (12)
- ungetc (12)
- wait (12)
-
wait
_ readable (12) -
wait
_ writable (24) - winsize (12)
- write (36)
-
write
_ nonblock (12)
検索結果
先頭5件
-
IO
# set _ encoding _ by _ bom -> Encoding | nil (113.0) -
BOM から IO のエンコーディングを設定します。
...BOM から IO のエンコーディングを設定します。
自身が BOM から始まる場合、BOM を読み進めて外部エンコーディングをセットし、セットしたエンコーディングを返します。
BOM が見つからなかった場合は nil を返します。
自......t", "rb") do |io|
p io.set_encoding_by_bom #=> #<Encoding:UTF-8>
str = io.read
p str #=> "abc"
p str.encoding #=> #<Encoding:UTF-8>
end
File.write("nobom.txt", "abc")
File.open("nobom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> nil
end
//}... -
IO
# binmode -> self (107.0) -
ストリームをバイナリモードにします。MSDOS などバイナリモードの存在 する OS でのみ有効です。そうでない場合このメソッドは何もしません。
...ンしかありません。
@raise Errno::EXXX モードの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.open(IO.sysopen("testfile", "w+")) do |io|
io.binmode? # => false
io.binmode # => #<IO:fd 8>
io.binmode? # => true
end
//}
@see c:IO#io_binmode, IO#binmode?... -
IO
# each _ char -> Enumerator (107.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...ません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
IO
# each _ char {|c| . . . } -> self (107.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...ません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
IO
# external _ encoding -> Encoding | nil (107.0) -
IO の外部エンコーディングを返します。 外部エンコーディングが指定されていない場合は nil を返します。 ただし読み込み専用モードの場合は Encoding.default_external になります。
...
IO の外部エンコーディングを返します。
外部エンコーディングが指定されていない場合は nil を返します。
ただし読み込み専用モードの場合は Encoding.default_external になります。
//emlist[例][ruby]{
IO.write("testfile", "abcde")
File.ope......n("testfile") { |f| p f.external_encoding } # => #<Encoding:UTF-8>
//}... -
IO
# internal _ encoding -> Encoding | nil (107.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
# reopen(path) -> self (107.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("test.......new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//... -
IO
# reopen(path , mode) -> self (107.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("test.......new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//... -
IO
# ungetbyte(c) -> nil (107.0) -
指定したバイト列を書き戻します。
...し(IO#sysread など)
には影響しません。
@param c バイト列(文字列)、もしくは0から255までの整数
例:
f = File.new("testfile") #=> #<File:testfile>
b = f.getbyte #=> 0x38
f.ungetbyte(b) #=> nil
f.getbyte #=> 0x38...