るりまサーチ

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

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

ライブラリ

キーワード

検索結果

<< < 1 2 >>

Kernel.#test(cmd, file1, file2) -> bool (34.0)

2ファイル間のファイルテストを行います。

...とみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 真偽値を返します。

以下は cmd...
...ァイル1とファイル2が同一のファイルである

//emlist[例][ruby]{
IO
.write("testfile1", "test1")
IO
.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts
"#{e}: #{result}"
end
//}

# => =: true
# => <: false
# => >: false
# => -: fals...

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (19.0)

単体のファイルでファイルテストを行います。

...列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返します。

以下は cmd として...
...me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time

//emlist[例][ruby]{
IO
.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}...

Kernel.#print(*arg) -> nil (14.0)

引数を順に標準出力 $stdout に出力します。引数が与えられない時には変数 $_ の値を出力します。

...ットされている時には、最後にそれを出力します。

@param arg 出力するオブジェクトを任意個指定します。
@raise IOError 標準出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発...
...生します。

//emlist[例][ruby]{
print "Hello, world!"
print "Regexp is",/ant/
print nil
print "\n"
#=> Hello, world!Regexp is(?-mix:ant)

$_ = "input"
$, = "<and>"
$\ = "<end>\n"
print
print "AA","BB"
#=> input<end>
#=> AA<and>BB<end>
//}

@see Kernel.#puts,Kernel.#p,IO#print...
<< < 1 2 >>