種類
- 特異メソッド (708)
- インスタンスメソッド (131)
- 定数 (44)
ライブラリ
- ビルトイン (883)
キーワード
-
ALT
_ SEPARATOR (11) -
PATH
_ SEPARATOR (11) - SEPARATOR (11)
- Separator (11)
-
absolute
_ path (11) -
absolute
_ path? (5) - atime (22)
- basename (11)
- birthtime (20)
- blockdev? (11)
- chardev? (11)
- chmod (22)
- chown (22)
- ctime (22)
- delete (11)
- directory? (11)
- dirname (11)
- empty? (8)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- exists? (9)
- extname (11)
- file? (11)
- flock (11)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- grpowned? (11)
- identical? (11)
- join (11)
- lchmod (11)
- lchown (11)
- link (11)
- lstat (22)
- lutime (7)
- mkfifo (9)
- mtime (22)
- new (11)
- open (22)
- owned? (11)
- path (22)
- pipe? (11)
- readable? (11)
-
readable
_ real? (11) - readlink (11)
- realdirpath (11)
- realpath (11)
- rename (11)
- setgid? (11)
- setuid? (11)
- size (22)
- size? (11)
- socket? (11)
- split (11)
- stat (11)
- sticky? (11)
- symlink (11)
- symlink? (11)
-
to
_ path (11) - truncate (22)
- umask (22)
- unlink (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - zero? (11)
検索結果
先頭5件
-
File
. open(path , mode = "r" , perm = 0666) -> File (1.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......mlist[例: File.new による読み込みモードでのファイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close......//}
//emlist[例: File.open による書き込みモードでのファイルオープン][ruby]{
File.open("testfile", "w", 0755) { |f| f.print "test" }
File.read("testfile") # => "test"
//}... -
File
. open(path , mode = "r" , perm = 0666) {|file| . . . } -> object (1.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......mlist[例: File.new による読み込みモードでのファイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close......//}
//emlist[例: File.open による書き込みモードでのファイルオープン][ruby]{
File.open("testfile", "w", 0755) { |f| f.print "test" }
File.read("testfile") # => "test"
//}... -
File
. owned?(path) -> bool (1.0) -
FileTest.#owned? と同じです。
...
FileTest.#owned? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. path(filename) -> String (1.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
...指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
requ......ire 'pathname'
class MyPath
def initialize(path)
@path = path
end
def to_path
File.absolute_path(@path)
end
end
File.path("/dev/null") # => "/dev/null"
File.path(Pathname("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}... -
File
. pipe?(path) -> bool (1.0) -
FileTest.#pipe? と同じです。
...
FileTest.#pipe? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. readable?(path) -> bool (1.0) -
FileTest.#readable? と同じです。
...
FileTest.#readable? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. readable _ real?(path) -> bool (1.0) -
FileTest.#readable_real? と同じです。
...
FileTest.#readable_real? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. readlink(path) -> String (1.0) -
シンボリックリンクのリンク先のパスを文字列で返します。
...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.symlink("testfile", "testlink") # => 0
File.readlink("testlink") # => "testfile"
//}... -
File
. realdirpath(pathname , basedir = nil) -> String (1.0) -
与えられた pathname に対応する絶対パスを返します。
与えられた pathname に対応する絶対パスを返します。
pathname の最後のコンポーネントは存在していなくても例外は発生しません。
@param pathname ファイル名を指定します。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリを使用します。
@raise Errno::ENOENT ファイルが存在しない場合に発生します。 -
File
. realpath(pathname , basedir = nil) -> String (1.0) -
与えられた pathname に対応する絶対パスを返します。
...合に発生します。
//emlist[例][ruby]{
ENV["HOME"] # => "/home/matz"
File.symlink("testfile", "testlink")
File.realpath("testfile") # => "/home/matz/testfile"
File.realpath("testlink") # => "/home/matz/testfile"
File.realpath("..", "/tmp") # => "/"
//}...