るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
7件ヒット [1-7件を表示] (0.102秒)

別のキーワード

  1. _builtin arg
  2. etc sc_arg_max
  3. mkmf arg_config
  4. float arg
  5. rake arg_names

ライブラリ

クラス

キーワード

検索結果

ARGF.class#write(str) -> Integer (63325.0)

処理対象のファイルに対して str を出力します。 str が文字列でなければ to_s による文字列化を試みます。 実際に出力できたバイト数を返します。

処理対象のファイルに対して str を出力します。
str が文字列でなければ to_s による文字列化を試みます。
実際に出力できたバイト数を返します。

c:ARGF#inplace時にのみ使用できます。

@param str 出力する文字列を指定します。

@see ARGF.class#to_write_io

ARGF.class#to_write_io -> IO (27325.0)

処理対象のファイルへの書き出し用 IO オブジェクトを返します。

処理対象のファイルへの書き出し用 IO オブジェクトを返します。

c:ARGF#inplace時以外は読み込み用の IO オブジェクトを返します。
このため ARGF.class#write などの書き出し用メソッドを呼ぶと IOError が発生します。

Zlib::GzipWriter#printf(format, *args) -> nil (9304.0)

C 言語の printf と同じように、format に従い引数 を文字列に変換して、自身に出力します。

C 言語の printf と同じように、format に従い引数
を文字列に変換して、自身に出力します。

@param format フォーマット文字列を指定します。print_format を参照してください。

@param args フォーマットされるオブジェクトを指定します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.printf("\n%9s", "b...

ARGF.class#to_io -> IO (9022.0)

ARGFが現在開いているファイルのFile、またはIOオブジェクトを 返します。

ARGFが現在開いているファイルのFile、またはIOオブジェクトを
返します。

ARGF.to_io # => #<File:glark.txt>
ARGF.to_io # => #<IO:<STDIN>>

@see ARGF.class#file, ARGF.class#to_write_io

Pathname#each_line(*args) -> Enumerator (376.0)

IO.foreach(self.to_s, *args, &block) と同じです。

IO.foreach(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\...

絞り込み条件を変える

Pathname#each_line(*args) {|line| ... } -> nil (376.0)

IO.foreach(self.to_s, *args, &block) と同じです。

IO.foreach(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\...

IO#fcntl(cmd, arg = 0) -> Integer (361.0)

IOに対してシステムコール fcntl を実行します。 機能の詳細は fcntl(2) を参照してください。 fcntl(2) が返した整数を返します。

IOに対してシステムコール fcntl を実行します。
機能の詳細は fcntl(2) を参照してください。
fcntl(2) が返した整数を返します。

@param cmd IO に対するコマンドを、添付ライブラリ fcntl が提供している定数で指定します。

@param arg cmd に対する引数を整数、文字列、booleanのいずれかで指定します。
整数の時にはその値を fcntl(2) に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の...