ライブラリ
- English (33)
- ビルトイン (701)
- csv (121)
- erb (33)
- fileutils (11)
-
irb
/ input-method (44) -
net
/ http (44) - open-uri (30)
- openssl (33)
- pathname (11)
- pstore (11)
- readline (22)
-
rubygems
/ package / tar _ reader / entry (11) -
rubygems
/ source _ info _ cache (11) - shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (18) - tempfile (33)
- thread (2)
- timeout (19)
-
yaml
/ store (8) - zlib (154)
クラス
-
ARGF
. class (55) - CSV (110)
- Dir (44)
- ERB (33)
- File (99)
-
File
:: Stat (44) -
Gem
:: Package :: TarReader :: Entry (11) -
Gem
:: SourceInfoCache (11) - IO (316)
-
IRB
:: InputMethod (11) -
IRB
:: ReadlineInputMethod (22) -
IRB
:: StdioInputMethod (11) - Method (12)
-
Net
:: HTTPGenericRequest (22) -
Net
:: HTTPResponse (22) -
OpenSSL
:: PKCS7 (11) - PStore (11)
- Pathname (11)
- Proc (12)
- Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (18) - String (11)
- Tempfile (33)
-
YAML
:: Store (8) -
Zlib
:: GzipReader (77) -
Zlib
:: GzipWriter (77)
モジュール
- FileTest (33)
- FileUtils (11)
- Kernel (96)
-
OpenSSL
:: ASN1 (11) -
OpenSSL
:: Random (11) - OpenURI (22)
- Readline (22)
- Timeout (19)
キーワード
-
$ DEFAULT _ OUTPUT (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ NR (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (34)
- >> (12)
- CSV (11)
- ConditionVariable (11)
-
FILENAME
_ COMPLETION _ PROC (11) - IO (11)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) -
add
_ row (11) - birthtime (11)
-
body
_ stream (11) -
body
_ stream= (11) - clone (11)
- close (11)
- closed? (11)
-
copy
_ stream (11) - count (11)
- decode (11)
-
def
_ class (11) - dup (11)
- eof? (11)
- fdatasync (11)
- file? (11)
- filename (22)
- filename= (11)
-
filename
_ quote _ characters (11) - flock (11)
- flush (22)
- getc (11)
- link (11)
-
load
_ random _ file (11) - new (74)
- open (140)
-
open
_ uri (22) - path (11)
- pread (7)
- print (11)
- printf (11)
- putc (11)
- puts (22)
- pwrite (7)
-
rdoc
/ parser / c (11) -
read
_ body (22) -
read
_ cache _ data (11) - readable? (51)
-
readable
_ atfer _ eof? (33) -
readable
_ real? (51) - readbyte (22)
- readchar (33)
- readline (55)
- readlines (77)
- readlink (40)
- rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11) -
set
_ encoding _ by _ bom (5) - spawn (44)
- sysread (11)
- sysseek (11)
- syswrite (11)
- timeout (19)
- ungetc (11)
-
world
_ readable? (33) - wrap (22)
- write (22)
-
write
_ smime (11)
検索結果
先頭5件
-
IO
. read(path , **opt) -> String | nil (18269.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , **opt) -> String | nil (18269.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
IO
. read(path , length = nil , offset = 0 , **opt) -> String | nil (18269.0) -
path で指定されたファイルを offset 位置から length バイト分読み込んで返します。
...合は nil を返します。ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。例えば、IO.read(空ファイル) は "" を返します。
引数 length が指定された場合はバイナリ読み込みメソッド、そうでない場合は......ng など
IO.open のオプション引数が指定できます。
@see IO.binread
例:
IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byte_file, 1, 10) #=> nil... -
ARGF
. class # file -> IO (18247.0) -
現在開いている処理対象の File オブジェクト(または IO オブジェ クト)を返します。
...開いている処理対象の File オブジェクト(または IO オブジェ
クト)を返します。
$ echo "foo" > foo
$ echo "bar" > bar
$ ruby argf.rb foo bar
ARGF.file # => #<File:foo>
ARGF.read(5) # => "foo\nb"
ARGF.file # => #<File:bar>
ARGFが現在開いて... -
Dir
# read -> String | nil (18243.0) -
ディレクトリストリームから次の要素を読み出して返します。最後の要素 まで読み出していれば nil を返します。
...o |tmpdir|
File.open("#{tmpdir}/test1.txt", "w") { |f| f.puts("test1") }
File.open("#{tmpdir}/test2.txt", "w") { |f| f.puts("test2") }
Dir.open(tmpdir) do |d|
p d.read # => "."
p d.read # => ".."
p d.read # => "test1.txt"
p d.read # => "test2.txt"
p d.read # => ni... -
IO
# read(length = nil , outbuf = "") -> String | nil (18237.0) -
length バイト読み込んで、その文字列を返します。
...ただし、length に nil か 0 が指定されている場合は、空文字列 "" を返します。
例えば、open(空ファイル) {|f| f.read } は "" となります。
@param length 読み込むサイズを整数で指定します。
nil が指定された場合、EOF ま......全てのデータを読み込んで、その文字列を返します。
@param outbuf 出力用のバッファを文字列で指定します。IO#read は読み込んだ
データをその文字列オブジェクトに上書きして返します。指定し
た文字列......負の場合に発生します。
第二引数を指定した read の呼び出しでデータが空であった場合
(read が nil を返す場合)、outbuf は空文字列になります。
outbuf = "x" * 20;
io = File.open("/dev/null")
p io.read(10,outbuf)
p outbuf
=> nil
""... -
CSV
. read(path , options = Hash . new) -> [Array] | CSV :: Table (18225.0) -
CSV ファイルを配列の配列にするために使います。 headers オプションに偽でない値を指定した場合は CSV::Table オブジェクトを返します。
...なければなりません。
//emlist[例][ruby]{
require "csv"
require "pp"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
pp CSV.read("test.csv")
# => [["id", "first name", "last name", "age"],
# ["1", "taro",......,
# ["4", "yumi", "adachi", "21"]]
//}
//emlist[例][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
table = CSV.read("test.csv", headers: true)
p table.class # => CSV::Table
p table[0] # =>... -
File
. readlink(path) -> String (15212.0) -
シンボリックリンクのリンク先のパスを文字列で返します。
...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.symlink("testfile", "testlink") # => 0
File.readlink("testlink") # => "testfile"
//}... -
File
. world _ readable?(path) -> Integer | nil (15206.0) -
path が全てのユーザから読めるならばそのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。
...場合は nil を返します。
整数の意味はプラットフォームに依存します。
@param path パスを表す文字列か IO オブジェクトを指定します。
//emlist[例][ruby]{
m = File.world_readable?("/etc/passwd")
"%o" % m # => "644"
//}... -
File
. readable?(path) -> bool (15200.0) -
FileTest.#readable? と同じです。
...
FileTest.#readable? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。...