るりまサーチ

最速Rubyリファレンスマニュアル検索!
708件ヒット [401-500件を表示] (0.009秒)
トップページ > クラス:File[x] > 種類:特異メソッド[x]

ライブラリ

キーワード

検索結果

<< < ... 3 4 5 6 7 ... > >>

File.path(filename) -> String (2.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 (2.0)

FileTest.#pipe? と同じです。

...
File
Test.#pipe? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

File.readable?(path) -> bool (2.0)

FileTest.#readable? と同じです。

...
File
Test.#readable? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

File.readable_real?(path) -> bool (2.0)

FileTest.#readable_real? と同じです。

...
File
Test.#readable_real? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

File.readlink(path) -> String (2.0)

シンボリックリンクのリンク先のパスを文字列で返します。

...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.symlink("testfile", "testlink") # => 0
File
.readlink("testlink") # => "testfile"
//}...

絞り込み条件を変える

File.realdirpath(pathname, basedir = nil) -> String (2.0)

与えられた pathname に対応する絶対パスを返します。

与えられた pathname に対応する絶対パスを返します。

pathname の最後のコンポーネントは存在していなくても例外は発生しません。

@param pathname ファイル名を指定します。

@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリを使用します。

@raise Errno::ENOENT ファイルが存在しない場合に発生します。

File.realpath(pathname, basedir = nil) -> String (2.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") # => "/"
//}...

File.rename(from, to) -> 0 (2.0)

ファイルの名前を変更します。ディレクトリが異なる場合には移動も行い ます。rename(2) を参照してください。移動先のファ イルが存在する時には上書きされます。

...{
begin
File
.rename("testfile", "testfile.bak") # => 0
File
.rename("testfile", "testfile.bak")
rescue
# 2回目の rename 時にすでに testfile が存在しないため例外が発生する
$! # => #<Errno::ENOENT: No such file or directory @ rb_file_s_rename - (testfile, testfile.bak)>...

File.setgid?(path) -> bool (2.0)

FileTest.#setgid? と同じです。

...
File
Test.#setgid? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

File.setuid?(path) -> bool (2.0)

FileTest.#setuid? と同じです。

...
File
Test.#setuid? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

絞り込み条件を変える

<< < ... 3 4 5 6 7 ... > >>