360件ヒット
[1-100件を表示]
(0.072秒)
別のキーワード
ライブラリ
- ビルトイン (120)
- bigdecimal (36)
- csv (132)
-
irb
/ context (36) - stringio (24)
- un (12)
クラス
-
ARGF
. class (36) - BigDecimal (36)
- CSV (24)
-
CSV
:: Table (108) - File (12)
-
File
:: Stat (12) - IO (60)
-
IRB
:: Context (36) - StringIO (24)
モジュール
- Kernel (12)
キーワード
- [] (36)
- binmode (24)
-
by
_ col _ or _ row (12) -
by
_ col _ or _ row! (12) -
by
_ row (12) -
by
_ row! (12) - chmod (24)
-
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (12)
-
prompt
_ mode (12) - read (12)
- readlines (12)
- reopen (60)
- round (36)
- stat (12)
-
use
_ readline (12) -
use
_ readline? (12)
検索結果
先頭5件
-
CSV
:: Table # mode -> Symbol (18220.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 (18214.0) -
ファイルモードを返します。
...ファイルモードを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
printf "%o\n", fs.mode
#例
#=> 100644
//}... -
ARGF
. class # inplace _ mode -> String | nil (6256.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...il を返します。
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 #......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=... -
ARGF
. class # binmode -> self (6243.0) -
self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。
...を ASCII-8BIT として扱う
例:
# test1.png - 164B
# test2.png - 128B
# 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 test......1.png test2.png
ARGF.read.size # => 290
@see IO#binmode, ARGF.class#binmode?... -
IRB
:: Context # prompt _ mode -> Symbol (6220.0) -
現在のプロンプトモードを Symbol で返します。
...そうでない場合は、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、:XMP、:NULL
のいずれかを返します。
定義済みのプロンプトモードの内容については、IRB.conf[:PROMPT][mode] を
参照してください。
@see IRB::Context#prompt_mode=, lib:irb#customize_prompt... -
IO
# binmode -> self (6207.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?... -
ARGF
. class # inplace _ mode=(ext) (6192.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...。
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf.......rb file.txt
---- argf.rb ----
# 引数のファイル中の各行の最初の "foo" を "bar" で置き換える
ARGF.inplace_mode = '.bak'
ARGF.lines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")......' file.txt
---- -i オプションを使う場合その2 ----
$ ruby -i.bak -n -e 'print $_.sub("foo","bar")' file.txt
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode... -
File
# chmod(mode) -> 0 (230.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 (227.0) -
自身が表す文字列が指定された文字列 str になります。
...自身が表す文字列が指定された文字列 str になります。
与えられた str がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数と......換えられます。
@param mode Kernel.#open 同様文字列か整数で自身のモードを指定します。
@raise Errno::EACCES str がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。
//emlist[例][ruby]{
require 'stringio'
sio = S...