るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.022秒)
トップページ > クエリ:File[x] > クエリ:test[x] > クエリ:socket?[x]

別のキーワード

  1. kernel test
  2. _builtin test
  3. rubygems/test_utilities tempio
  4. rubygems/test_utilities fetcher=
  5. testtask test_files=

ライブラリ

モジュール

検索結果

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

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

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

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

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

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