るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.061秒)
トップページ > バージョン:2.3.0[x] > クエリ:IO[x] > クエリ:p[x] > クエリ:io[x] > モジュール:FileTest[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

FileTest.#grpowned?(file) -> bool (18412.0)

ファイルのグループ ID がカレントプロセスの実効グループ ID と等しい時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "")
File.chown(-1, Process.gid, "testfile")
FileTest
.grpowned?("testfile") # => true
File.chown(-1, Process.gid + 10, "testfile")
FileTest
.grpowned?("testfile") # => false
//}...

FileTest.#pipe?(file) -> bool (18412.0)

指定したファイルがパイプである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

例:
r, w = IO.pipe
FileTest
.pipe?(r) # => true
FileTest
.pipe?(w) # => true...

FileTest.#identical?(file1, file2) -> bool (202.0)

file1 と file2 が同じファイルを指している時に真を返します。 そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

file1 と file2 が同じファイルを指している時に真を返します。
そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

ruby 1.8.3 以前ではKernel.#test(?-, file1, file2)を使ってください。

open("a", "w") {}
p File.identical?("a", "a") #=> true
p File.identical?("a", "./a") #=> true
File.link("a", "b")
p File.identical...

FileTest.#socket?(file) -> bool (148.0)

ファイルがソケットである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...が既に close されていた場合に発生します。

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

IO.write("testfile", "test")
p FileTest.socket?("testfile") # => false
Socket.unix_server_socket('testsock') { p FileTest.socket?('testsock') } # => true
//}...