るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

CSV::Table#mode -> Symbol (18226.0)

現在のアクセスモードを返します。

...現在のアクセスモードを返します。

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

row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
table = CSV::Table.new([row])
table.mode # => :col_or_row
table.by_col!
table.mode # => :col
//}...

File::Stat#mode -> Integer (18220.0)

ファイルモードを返します。

...ファイルモードを返します。

//emlist[][ruby]{
fs = File::Stat.new($0)
printf "%o\n", fs.mode
#例
#=> 100644
//}...

ARGF.class#inplace_mode -> String | nil (6274.0)

c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。

...ます。

Ruby
起動時の -i オプション や ARGF.class#inplace_mode= で設定します。

例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"

# test.rb
ARGF.inplace_mode # => ".bak"...
...ine {|e|print e.upcase} # => "TEST"

例:
# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"

# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"

@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=...

IRB::Context#prompt_mode -> Symbol (6226.0)

現在のプロンプトモードを Symbol で返します。

...そうでない場合は、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、:XMP、:NULL
のいずれかを返します。

定義済みのプロンプトモードの内容については、IRB.conf[:PROMPT][mode] を
参照してください。

@see IRB::Context#prompt_mode=, lib:irb#customize_prompt...

ARGF.class#binmode -> self (6225.0)

self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。

...test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARGF.binmode
ARGF.read.size # => 292

例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARGF.read.size # => 290

@see IO#binmode, ARGF.class#binmode?...

絞り込み条件を変える

IO#binmode -> self (6219.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?...

File#chmod(mode) -> 0 (236.0)

ファイルのモードを指定された mode に変更します。

...ファイルのモードを指定された mode に変更します。

モードの変更に成功した場合は 0 を返します。失敗した場合は例外 Errno::EXXX が発生し
ます。

@param mode chmod(2) と同様に整数で指定します。

@raise IOError 自身が close され...
...ている場合に発生します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
f = File.new("out", "w");
f.chmod(0644) #=> 0
//}...

StringIO#reopen(str, mode = &#39;r+&#39;) -> StringIO (234.0)

自身が表す文字列が指定された文字列 str になります。

...自身が表す文字列が指定された文字列 str になります。

与えられた str がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数と...
...換えられます。

@param mode Kernel.#open 同様文字列か整数で自身のモードを指定します。

@raise Errno::EACCES str がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。

//emlist[例][ruby]{
require 'stringio'
sio = S...
...tringIO.new("hoge", 'r+')
sio.reopen('foo')
p sio.read #=> "foo"
//}...

IO#reopen(path, mode) -> self (226.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...ます。

@param path パスを表す文字列を指定します。

@param mode パスを開く際のモードを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.n...
....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
//...
<< 1 2 3 ... > >>