るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin filetest
  2. filetest size
  3. filetest pipe?
  4. filetest file?
  5. filetest size?

ライブラリ

クラス

キーワード

検索結果

Pathname#blockdev? -> bool (70.0)

FileTest.blockdev?(self.to_s) と同じです。

FileTest.blockdev?(self.to_s) と同じです。


@see FileTest.#blockdev?

Pathname#chardev? -> bool (70.0)

FileTest.chardev?(self.to_s) と同じです。

FileTest.chardev?(self.to_s) と同じです。


@see FileTest.#chardev?

Pathname#directory? -> bool (70.0)

FileTest.directory?(self.to_s) と同じです。

FileTest.directory?(self.to_s) と同じです。


@see FileTest.#directory?

Pathname#empty? -> bool (70.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'

Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
//}

//emlist[例 ファイルの場合][ruby]{
require "path...

Pathname#executable? -> bool (70.0)

FileTest.executable?(self.to_s) と同じです。

FileTest.executable?(self.to_s) と同じです。


@see FileTest.#executable?

絞り込み条件を変える

Pathname#executable_real? -> bool (70.0)

FileTest.executable_real?(self.to_s) と同じです。

FileTest.executable_real?(self.to_s) と同じです。


@see FileTest.#executable_real?

Pathname#exist? -> bool (70.0)

FileTest.exist?(self.to_s) と同じです。

FileTest.exist?(self.to_s) と同じです。


@see FileTest.#exist?

Pathname#file? -> bool (70.0)

FileTest.file?(self.to_s) と同じです。

FileTest.file?(self.to_s) と同じです。


@see FileTest.#file?

Pathname#grpowned? -> bool (70.0)

FileTest.grpowned?(self.to_s) と同じです。

FileTest.grpowned?(self.to_s) と同じです。


@see FileTest.#grpowned?

Pathname#owned? -> bool (70.0)

FileTest.owned?(self.to_s) と同じです。

FileTest.owned?(self.to_s) と同じです。


@see FileTest.#owned?

絞り込み条件を変える

Pathname#pipe? -> bool (70.0)

FileTest.pipe?(self.to_s) と同じです。

FileTest.pipe?(self.to_s) と同じです。


@see FileTest.#pipe?

Pathname#readable? -> bool (70.0)

FileTest.readable?(self.to_s) と同じです。

FileTest.readable?(self.to_s) と同じです。


@see FileTest.#readable?

Pathname#readable_real? -> bool (70.0)

FileTest.readable_real?(self.to_s) と同じです。

FileTest.readable_real?(self.to_s) と同じです。


@see FileTest.#readable_real?

Pathname#setgid? -> bool (70.0)

FileTest.setgid?(self.to_s) と同じです。

FileTest.setgid?(self.to_s) と同じです。


@see FileTest.#setgid?

Pathname#setuid? -> bool (70.0)

FileTest.setuid?(self.to_s) と同じです。

FileTest.setuid?(self.to_s) と同じです。


@see FileTest.#setuid?

絞り込み条件を変える

Pathname#size -> Integer (70.0)

FileTest.size(self.to_s) と同じです。

FileTest.size(self.to_s) と同じです。


@see FileTest.#size

Pathname#size? -> bool (70.0)

FileTest.size?(self.to_s) と同じです。

FileTest.size?(self.to_s) と同じです。


@see FileTest.#size?

Pathname#socket? -> bool (70.0)

FileTest.socket?(self.to_s) と同じです。

FileTest.socket?(self.to_s) と同じです。


@see FileTest.#socket?

Pathname#sticky? -> bool (70.0)

FileTest.sticky?(self.to_s) と同じです。

FileTest.sticky?(self.to_s) と同じです。


@see FileTest.#sticky?

Pathname#symlink? -> bool (70.0)

FileTest.symlink?(self.to_s) と同じです。

FileTest.symlink?(self.to_s) と同じです。


@see FileTest.#symlink?

絞り込み条件を変える

Pathname#world_readable? -> bool (70.0)

FileTest.world_readable?(self.to_s) と同じです。

FileTest.world_readable?(self.to_s) と同じです。


@see FileTest.#world_readable?

Pathname#world_writable? -> bool (70.0)

FileTest.world_writable?(self.to_s) と同じです。

FileTest.world_writable?(self.to_s) と同じです。


@see FileTest.#world_writable?

Pathname#writable? -> bool (70.0)

FileTest.writable?(self.to_s) と同じです。

FileTest.writable?(self.to_s) と同じです。


@see FileTest.#writable?

Pathname#writable_real? -> bool (70.0)

FileTest.writable_real?(self.to_s) と同じです。

FileTest.writable_real?(self.to_s) と同じです。


@see FileTest.#writable_real?

Pathname#zero? -> bool (70.0)

FileTest.zero?(self.to_s) と同じです。

FileTest.zero?(self.to_s) と同じです。


@see FileTest.#zero?
, Pathname#empty?

絞り込み条件を変える

Module#include(*mod) -> self (40.0)

モジュール mod をインクルードします。

モジュール mod をインクルードします。

@param mod Module のインスタンス( Enumerable など)を指定します。

@raise ArgumentError 継承関係が循環してしまうような include を行った場合に発生します。

//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}

実行結果:

-:3:in `append_features': cyclic include detected (ArgumentError)
...

File::Stat#directory? -> bool (22.0)

ディレクトリの時に真を返します。

ディレクトリの時に真を返します。

//emlist[][ruby]{
p File::Stat.new($0).directory? #=> false
//}

@see FileTest.#directory?

File::Stat#size? -> Integer | nil (22.0)

サイズが0の時にはnil、それ以外の場合はファイルサイズを返します。

サイズが0の時にはnil、それ以外の場合はファイルサイズを返します。

//emlist[][ruby]{
require 'tempfile'

fp = Tempfile.new("temp")
p fp.size #=> 0
p File::Stat.new(fp.path).size? #=> nil
fp.print "not 0 "
fp.close
p FileTest.exist?(fp.path) #=> true
p File::Stat.new(fp.path).size? #=> 6
//}

File::Stat#symlink? -> false (22.0)

シンボリックリンクである時に真を返します。 ただし、File::Statは自動的にシンボリックリンクをたどっていくので 常にfalseを返します。

シンボリックリンクである時に真を返します。
ただし、File::Statは自動的にシンボリックリンクをたどっていくので
常にfalseを返します。

//emlist[][ruby]{
require 'fileutils'
outfile = $0 + ".ln"
FileUtils.ln_s($0, outfile)
p File::Stat.new(outfile).symlink? #=> false
p File.lstat(outfile).symlink? #=> true
p FileTest.symlink?(outfile) #=> true
//}

...

Tempfile#close! -> nil (22.0)

テンポラリファイルをクローズし、すぐに削除します。

テンポラリファイルをクローズし、すぐに削除します。

require "tempfile"
tf = Tempfile.open("bar")
path = tf.path
tf.close!
p FileTest.exist?(path) # => false

絞り込み条件を変える

Tempfile#close(real = false) -> nil (22.0)

テンポラリファイルをクローズします。 real が偽ならば、テンポラリファイルはGCによって削除されます。 そうでなければ、すぐに削除されます。

テンポラリファイルをクローズします。
real が偽ならば、テンポラリファイルはGCによって削除されます。
そうでなければ、すぐに削除されます。

@param real false もしくはそれ以外を指定します。

require "tempfile"
tf = Tempfile.open("bar")
tf.close
p FileTest.exist?(tf.path) # => true