るりまサーチ

最速Rubyリファレンスマニュアル検索!
318件ヒット [1-100件を表示] (0.091秒)
トップページ > クエリ:t[x] > モジュール:FileTest[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

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

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("o+t", "testfile")
FileTest
.sticky?("testfile") # => true
FileUtils.chmod("o-t", "testfile")
FileTest
.sticky?("testfile") # => false
//}...

FileTest.#directory?(file) -> bool (6101.0)

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

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

例:
FileTest
.directory?('/etc') # => true
FileTest
.directory?('/etc/passwd') # => false

f = File.open('/etc')
FileTest
.directory?(f) # => true
f.close
FileTest
.directory?(f) # => IOError: closed stream...

FileTest.#empty?(file) -> bool (6101.0)

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

...された 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.#executable?(file) -> bool (6101.0)

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

...合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

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

例:
FileTest
.executable?('/bin') # => true
FileTest
.executable?('/bin/bash') # => true...

FileTest.#executable_real?(file) -> bool (6101.0)

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

...ます。

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

//emlist[例][ruby]{
IO.write("empty.txt", "")
File.chmod(0744, "empty.txt")
FileTest
.executable_real?("empty.txt") # => true
File.chmod(0644, "empty.txt")
FileTest
.executable_real?("empty.txt") # => false
//}...

絞り込み条件を変える

FileTest.#exist?(file) -> bool (6101.0)

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

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

例:
FileTest
.exist?('/etc/passwd') # => true
FileTest
.exist?('/etc') # => true
FileTest
.exist?('/etc/no_such_file') # => false
FileTest
.exist?('/etc/no_such_directory') # => false...

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

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

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

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

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

...nel.#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?("a", "b") #=> true
File.symlink("a", "c")
p File.identical?("a", "c") #=> true...
...open("d", "w") {}
p File.identical?("a", "d") #=> false

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

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

@raise IOError 指定された IO オブジェ...

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

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

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

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

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("g+s", "testfile")
FileTest
.setgid?("testfile") # => true
FileUtils.chmod("g-s", "testfile")
FileTest
.setgid?("testfile") # => false
//}...
<< 1 2 3 ... > >>