773件ヒット
[301-400件を表示]
(0.101秒)
ライブラリ
- ビルトイン (773)
キーワード
-
absolute
_ path (12) -
absolute
_ path? (6) - atime (12)
- basename (12)
- birthtime (11)
- blockdev? (12)
- chardev? (12)
- chmod (12)
- chown (12)
- ctime (12)
- delete (12)
- directory? (12)
- dirname (12)
- empty? (9)
- executable? (12)
-
executable
_ real? (12) - exist? (12)
- exists? (9)
- extname (12)
- file? (12)
- fnmatch (12)
- fnmatch? (12)
- ftype (12)
- grpowned? (12)
- identical? (12)
- join (12)
- lchmod (12)
- lchown (12)
- link (12)
- lstat (12)
- lutime (8)
- mkfifo (10)
- mtime (12)
- new (12)
- open (24)
- owned? (12)
- path (12)
- pipe? (12)
- readable? (12)
-
readable
_ real? (12) - readlink (12)
- realdirpath (12)
- realpath (12)
- rename (12)
- setgid? (12)
- setuid? (12)
- size (12)
- size? (12)
- socket? (12)
- split (12)
- stat (12)
- sticky? (12)
- symlink (12)
- symlink? (12)
- truncate (12)
- umask (24)
- unlink (12)
- utime (12)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - zero? (12)
検索結果
先頭5件
-
File
. mtime(filename) -> Time (9114.0) -
最終更新時刻を返します。
...更新時刻を返します。
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例][ruby]{
File.mtime(__FILE__) # => 2017-12-03 03:16:22 +0900
//}... -
File
. birthtime(filename) -> Time (9108.0) -
作成された時刻を返します。
...作成された時刻を返します。
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
@raise NotImplementedError Windows のような birthtime のない......環境で発生します。
//emlist[例][ruby]{
File.birthtime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
//}... -
File
. chmod(mode , *filename) -> Integer (9102.0) -
ファイルのモードを mode に変更します。モードを変更したファイ ルの数を返します。
...ファイルのモードを mode に変更します。モードを変更したファイ
ルの数を返します。
@param filename ファイル名を表す文字列を指定します。
@param mode chmod(2) と同様に整数で指定します。
@raise Errno::EXXX モードの変更に失敗... -
File
. join(*item) -> String (9078.0) -
File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
...
File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
@param item 連結したいディレクトリ名やファイル名を文字列(もしくは文字列を要素に持つ配列)で与えます。
文字列A......とBを連結する際に、Aの末尾の文字とBの先頭の文字がFile::SEPARATORであった場合には、
まずこれらを削除した上で改めてFile::SEPARATORを間に入れて連結します。
引数の中に配列がある場合は配列要素を再帰的......t[例][ruby]{
File.join("a","b") # => "a/b"
File.join("a/","b") # => "a/b"
File.join("a/","/b") # => "a/b"
File.join("a","/b") # => "a/b"
File.join("a", ["b", ["c", ["d"]]]) # => "a/b/c/d"
File.join("", "a"... -
File
. expand _ path(path , default _ dir = & # 39; . & # 39;) -> String (9026.0) -
path を絶対パスに展開した文字列を返します。 path が相対パスであれば default_dir を基準にします。
...> "/home/matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/home/matz/work"
p File.expand_path("..", "/tmp") #=> "/"
p File.expand_path("~") #=> "/home/matz"
p File.expand_path("~foo") #=> "/home/foo"
//}
@param path パスを表... -
File
. realpath(pathname , basedir = nil) -> String (9026.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 (9026.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
. exists?(path) -> bool (9018.0) -
このメソッドは Ruby 2.1 から deprecated です。File.exist? を使用してください。
...このメソッドは Ruby 2.1 から deprecated です。File.exist? を使用してください。... -
File
. readlink(path) -> String (9014.0) -
シンボリックリンクのリンク先のパスを文字列で返します。
...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.symlink("testfile", "testlink") # => 0
File.readlink("testlink") # => "testfile"
//}...