るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < 1 2 >>

FileTest.#zero?(file) -> bool (3122.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...します。

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

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

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest
.zero?("zero.txt")...
...# => true
IO.write("nonzero.txt", "1")
FileTest
.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

FileTest.#setuid?(file) -> bool (3121.0)

ファイルが setuid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...

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

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

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
File
Utils.chmod("u...
...+s", "testfile")
FileTest
.setuid?("testfile") # => true
File
Utils.chmod("u-s", "testfile")
FileTest
.setuid?("testfile") # => false
//}...

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

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

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

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

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

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

FileTest.#symlink?(file) -> bool (3121.0)

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

...た場合などには false を返します。

@param file ファイル名を表す文字列を指定します。

//emlist[例][ruby]{
IO.write("testfile", "test")
FileTest
.symlink?("testfile") # => false
File
.symlink("testfile", "testlink")
FileTest
.symlink?("testlink") # => true
//}...

FileTest.#zero?(file) -> bool (3121.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...します。

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

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

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest
.zero?("zero.txt")...
...# => true
IO.write("nonzero.txt", "1")
FileTest
.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

絞り込み条件を変える

FileTest.#exists?(file) -> bool (3119.0)

このメソッドは Ruby 2.1 から deprecated です。FileTest.#exist? を使用してください。

...このメソッドは Ruby 2.1 から deprecated です。FileTest.#exist? を使用してください。...

FileTest.#setgid?(file) -> bool (3115.0)

ファイルが setgid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

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

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
File
Utils.chmod("g+s", "testfile")
FileTest
.setgid?("testfile") # => true
File
Utils.chmod("g-s", "testfile")
FileTest
.setgid?("testfile")...

FileTest.#sticky?(file) -> bool (3115.0)

ファイルの sticky ビット(chmod(2) 参照)が 立っている時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

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

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
File
Utils.chmod("o+t", "testfile")
FileTest
.sticky?("testfile") # => true
File
Utils.chmod("o-t", "testfile")
FileTest
.sticky?("testfile")...
<< < 1 2 >>