モジュール
- FileTest (266)
- Kernel (1009)
- Marshal (40)
- Math (270)
- ObjectSpace (100)
- Process (380)
-
Process
:: GID (110) -
Process
:: Sys (150) -
Process
:: UID (110) - Signal (40)
キーワード
- Array (10)
- Complex (20)
- Float (10)
- Hash (10)
- Integer (10)
- Rational (10)
- String (10)
-
_ _ callee _ _ (10) -
_ _ dir _ _ (10) -
_ _ method _ _ (10) -
_ id2ref (10) - ` (10)
- abort (20)
- acos (10)
- acosh (10)
- argv0 (10)
- asin (10)
- asinh (10)
-
at
_ exit (10) - atan (10)
- atan2 (10)
- atanh (10)
- autoload (10)
- autoload? (10)
- binding (10)
-
block
_ given? (10) - blockdev? (10)
- caller (30)
-
caller
_ locations (20) - catch (20)
- cbrt (10)
-
change
_ privilege (20) - chardev? (10)
- chomp (10)
- chop (10)
-
clock
_ gettime (10) - cos (10)
- cosh (10)
-
count
_ objects (10) - daemon (10)
-
define
_ finalizer (20) - detach (10)
- directory? (10)
- dump (20)
-
each
_ object (40) - egid (10)
- egid= (10)
- eid (20)
- eid= (20)
- empty? (7)
- erf (10)
- erfc (10)
- euid (10)
- euid= (10)
- eval (20)
- exec (40)
- executable? (10)
-
executable
_ real? (10) - exist? (10)
- exists? (9)
- exit (10)
- exit! (10)
- exp (10)
- fail (30)
- file? (10)
- fork (20)
- format (10)
- frexp (10)
-
from
_ name (20) - gamma (10)
-
garbage
_ collect (10) - getegid (10)
- geteuid (10)
- getgid (10)
- getpgid (10)
- getpgrp (10)
- getpriority (10)
- getrlimit (10)
- gets (10)
- getsid (10)
- getuid (10)
- gid (10)
- gid= (10)
-
global
_ variables (10) -
grant
_ privilege (20) - groups (10)
- groups= (10)
- grpowned? (10)
- gsub (30)
- hypot (10)
- identical? (10)
- initgroups (10)
- issetugid (10)
- iterator? (10)
- kill (10)
- lambda (16)
- ldexp (10)
- lgamma (10)
- list (10)
- load (20)
-
local
_ variables (10) - log (20)
- log10 (10)
- log2 (10)
- loop (20)
- maxgroups (10)
- maxgroups= (10)
- open (20)
- owned? (10)
- p (10)
- pid (10)
- pipe? (10)
- pp (6)
- ppid (10)
- print (10)
- printf (20)
- proc (17)
- putc (10)
- puts (10)
- raise (30)
- rand (20)
-
re
_ exchange (20) -
re
_ exchangeable? (20) - readable? (10)
-
readable
_ real? (10) - readline (10)
- readlines (10)
- require (10)
-
require
_ relative (10) - restore (10)
- rid (20)
- select (10)
-
set
_ trace _ func (10) - setegid (10)
- seteuid (10)
- setgid (10)
- setgid? (10)
- setpgid (10)
- setpgrp (10)
- setpriority (10)
- setproctitle (10)
- setregid (10)
- setresgid (10)
- setresuid (10)
- setreuid (10)
- setrgid (10)
- setrlimit (20)
- setruid (10)
- setsid (10)
- setuid (10)
- setuid? (10)
-
sid
_ available? (20) - signame (10)
- sin (10)
- sinh (10)
- size (10)
- size? (10)
- sleep (20)
- socket? (10)
- spawn (40)
- sprintf (10)
- sqrt (10)
- srand (20)
- sticky? (10)
- sub (20)
- switch (40)
- symlink? (10)
- syscall (10)
- system (40)
- tan (10)
- tanh (10)
- test (20)
- throw (10)
- times (10)
-
trace
_ var (30) - trap (40)
- uid (10)
- uid= (10)
-
undefine
_ finalizer (10) -
untrace
_ var (10) - wait (10)
- wait2 (10)
- waitall (10)
- waitpid (10)
- waitpid2 (10)
- warn (10)
-
world
_ readable? (10) -
world
_ writable? (10) - writable? (10)
-
writable
_ real? (10) - zero? (10)
検索結果
先頭5件
-
FileTest
. # blockdev?(file) -> bool (3.0) -
ファイルがブロックスペシャルファイルである時に真を返します。 そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルがブロックスペシャルファイルである時に真を返します。
そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
Dir.glob("/dev/*") { |file|
puts file if FileTest.blockdev?(file)
}
# /dev/disk0
# /dev/di... -
FileTest
. # chardev?(file) -> bool (3.0) -
ファイルがキャラクタスペシャルファイルの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルがキャラクタスペシャルファイルの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
Dir.glob("/dev/*") { |file|
puts file if FileTest.chardev?(file)
}
# /dev/console
# /dev/tty... -
FileTest
. # directory?(file) -> bool (3.0) -
ファイルがディレクトリの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルがディレクトリの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.directory?('/etc') # => true
FileTest.directory?('/etc/passwd') # => false
f = File.open('/etc')... -
FileTest
. # empty?(file) -> bool (3.0) -
ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。
ファイルが存在して、そのサイズが 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")
Fil... -
FileTest
. # executable?(file) -> bool (3.0) -
ファイルがカレントプロセスにより実行できる時に真を返しま す。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルがカレントプロセスにより実行できる時に真を返しま
す。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列を指定します。
例:
FileTest.executable?('/bin') # => true
FileTest.executable?('/bin/bash') # => true -
FileTest
. # executable _ real?(file) -> bool (3.0) -
ファイルがカレントプロセスの実ユーザか実グループで実行できる時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルがカレントプロセスの実ユーザか実グループで実行できる時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには 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.ex... -
FileTest
. # exist?(file) -> bool (3.0) -
ファイルが存在する時に真を返します。そうでない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルが存在する時に真を返します。そうでない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.exist?('/etc/passwd') # => true
FileTest.exist?('/etc') # => true
FileTest.exist?('/etc/no_such_file') # => false... -
FileTest
. # exists?(file) -> bool (3.0) -
このメソッドは Ruby 2.1 から deprecated です。FileTest.#exist? を使用してください。
このメソッドは Ruby 2.1 から deprecated です。FileTest.#exist? を使用してください。 -
FileTest
. # file?(file) -> bool (3.0) -
ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.file?('/bin/bash') # => true
FileTest.file?('/bin') # => false
FileTest.file?('/no_such_file') ... -
FileTest
. # grpowned?(file) -> bool (3.0) -
ファイルのグループ ID がカレントプロセスの実効グループ ID と等しい時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ファイルのグループ ID がカレントプロセスの実効グループ ID と等しい時に真を返
します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "")
File.chown(-1, Process.gid, "testfile")
FileT... -
FileTest
. # identical?(file1 , file2) -> bool (3.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...