種類
ライブラリ
- English (22)
- ビルトイン (2761)
- coverage (6)
- csv (165)
- digest (11)
- erb (33)
- fiddle (33)
- fileutils (402)
-
irb
/ cmd / load (33) - json (11)
- logger (22)
- mkmf (22)
-
net
/ http (88) - nkf (11)
- objspace (11)
- open-uri (2)
- open3 (11)
- openssl (11)
- optparse (11)
- pathname (198)
- psych (72)
- rake (330)
-
rake
/ loaders / makefile (11) -
rake
/ packagetask (22) -
rdoc
/ parser / ruby (11) - ripper (33)
-
ripper
/ filter (22) -
ripper
/ lexer (22) -
ripper
/ sexp (22) -
rubygems
/ commands / which _ command (11) -
rubygems
/ config _ file (22) -
rubygems
/ installer (11) -
rubygems
/ source _ index (11) -
test
/ unit (1) - thread (2)
- timeout (19)
- un (44)
-
webrick
/ httprequest (11) -
webrick
/ ssl (11) - win32ole (11)
- zlib (33)
クラス
-
ARGF
. class (88) - BasicObject (22)
- Binding (17)
- CSV (154)
- Class (11)
- Coverage (6)
- Dir (234)
- ERB (33)
-
Fiddle
:: Function (11) -
Fiddle
:: Pointer (22) - File (539)
-
File
:: Stat (473) -
Gem
:: ConfigFile (22) -
Gem
:: Installer (11) -
Gem
:: SourceIndex (11) - IO (580)
-
IRB
:: ExtendCommand :: Load (11) -
IRB
:: ExtendCommand :: Require (11) -
IRB
:: ExtendCommand :: Source (11) - Logger (22)
- Method (23)
-
Net
:: HTTP (44) -
Net
:: HTTPGenericRequest (22) -
Net
:: HTTPResponse (22) - Object (22)
- OptionParser (11)
- Pathname (198)
- Proc (12)
-
RDoc
:: Parser :: Ruby (11) -
Rake
:: Application (11) -
Rake
:: DefaultLoader (11) -
Rake
:: FileList (198) -
Rake
:: FileTask (22) -
Rake
:: MakefileLoader (11) -
Rake
:: PackageTask (22) - Ripper (77)
-
Ripper
:: Filter (22) -
RubyVM
:: InstructionSequence (99) - String (11)
-
WEBrick
:: HTTPRequest (11) -
WIN32OLE
_ TYPE (11) -
Zlib
:: GzipWriter (22)
モジュール
- Enumerable (11)
- FileTest (160)
- FileUtils (413)
-
GC
:: Profiler (44) - JSON (11)
- Kernel (411)
- Marshal (22)
- ObjectSpace (11)
-
OpenSSL
:: ASN1 (11) - Psych (72)
-
Rake
:: Cloneable (22) -
Rake
:: TaskManager (11) - RakeFileUtils (44)
-
RubyVM
:: AbstractSyntaxTree (8) -
Test
:: Unit (1) - Timeout (19)
-
WEBrick
:: Config (11)
キーワード
-
$ > (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ NR (11) -
$ stderr (11) -
$ stdin (11) -
$ stdout (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (23)
- <=> (11)
- == (11)
- >> (12)
- ARGF (11)
- Base (11)
- CSV (11)
- ConditionVariable (11)
- Constants (11)
- DATA (11)
- DOSISH 対応 (11)
- EXXX (11)
- GzipWriter (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NKF (11)
-
OPERATING
_ SYSTEM _ DEFAULTS (11) - Open3 (11)
-
PLATFORM
_ DEFAULTS (11) - Ruby用語集 (11)
- SSL (11)
- Stat (11)
- Time (11)
- WhichCommand (11)
- Win32ネイティブ版Rubyの互換性問題 (11)
- [] (33)
-
absolute
_ path (22) -
absolute
_ path? (5) -
add
_ row (11) - advise (11)
-
allocation
_ sourcefile (11) - ascend (22)
- atime (44)
-
base
_ label (11) - basename (22)
- bigdecimal (11)
- birthtime (21)
- blksize (11)
- blockdev? (11)
- blocks (11)
-
body
_ stream (11) -
body
_ stream= (11) - call (11)
- caller (33)
- cd (22)
-
cgi
/ session (11) - chardev? (11)
- chdir (22)
- chmod (33)
-
chmod
_ R (11) - chown (44)
-
chown
_ R (11) - chroot (11)
- chunk (11)
- cleanpath (11)
-
clear
_ exclude (11) - clone (22)
- close (22)
- closed? (11)
- cmp (11)
-
collect
_ method (11) - commands (11)
-
compare
_ file (11) - compile (22)
-
compile
_ file (11) -
compile
_ option= (11) - copy (11)
- count (11)
- cp (11)
-
cp
_ lr (6) -
cp
_ r (11) -
create
_ makefile (11) - ctime (44)
- debug (11)
- decode (11)
-
def
_ class (11) - delete (11)
- descend (22)
- dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - directory? (11)
- dirname (22)
-
drb
/ extservm (11) -
drb
/ ssl (11) - dump (33)
- dup (22)
- each (66)
-
each
_ byte (22) -
each
_ child (28) -
each
_ codepoint (22) -
each
_ filename (11) -
each
_ line (66) - egrep (11)
- empty? (8)
- entries (11)
- eval (11)
-
excluded
_ from _ list? (11) - executable? (11)
-
executable
_ real? (22) - execute (33)
- exist? (11)
- existing (11)
- existing! (11)
- exists? (27)
- ext (11)
-
external
_ encoding (11) - extname (11)
- fail (33)
- fcntl (11)
- fdatasync (11)
- fiddle (11)
- file (11)
- file? (11)
- filename (44)
- filename= (11)
- fileno (21)
- filter (33)
- find (11)
- finish (11)
- flock (11)
- flush (11)
- fnmatch (22)
- fnmatch? (11)
-
for
_ fd (11) - foreach (55)
-
formatted
_ program _ filename (11) - formatter (11)
- ftype (22)
- get (22)
- getbyte (11)
- getc (11)
- gets (11)
- gid (11)
- glob (22)
- grpowned? (22)
- gsub! (11)
- helpfile (11)
- home (22)
- identical? (22)
- import (11)
- ino (11)
-
inplace
_ mode= (11) - install (11)
-
install
_ rb (11) -
instance
_ eval (22) -
internal
_ encoding (11) - irb (11)
-
is
_ a? (11) - isatty (11)
- join (11)
-
kind
_ of? (11) - label (11)
- lchmod (11)
- lchown (11)
- lex (11)
-
line
_ stub (6) - link (22)
- ln (11)
-
ln
_ s (11) - load (55)
-
load
_ file (11) -
load
_ specification (11) -
load
_ stream (22) - logger (11)
- lstat (22)
- makedirs (11)
- mkdir (22)
-
mkdir
_ p (11) - mkfifo (9)
- mkpath (11)
- mode (11)
- move (11)
- mtime (33)
- mv (11)
- needed? (11)
- new (121)
- nlink (11)
-
nowrite
_ flag (11) -
nowrite
_ flag= (11) - of (11)
- open (134)
- optparse (11)
- owned? (22)
-
package
_ files (11) -
package
_ files= (11) - parameters (11)
- parse (22)
-
parse
_ file (8) - path (44)
- pathmap (11)
- pipe? (11)
- pos (11)
- pos= (11)
- post (22)
- pread (7)
- profile (6)
- puts (11)
- pwrite (7)
- query (11)
- raise (33)
- rake (11)
- rakefile (11)
-
raw
_ data (11) -
rb
_ compile _ error (11) -
rb
_ compile _ error _ with _ enc (11) -
rb
_ compile _ file (11) - rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) - rdoc (11)
-
rdoc
/ parser / c (11) - read (22)
-
read
_ body (22) - readable? (22)
-
readable
_ real? (11) - readbyte (22)
- readchar (11)
- readline (11)
- readlines (77)
- readlink (11)
- realpath (33)
- remove (11)
-
remove
_ entry (11) - rename (11)
- reopen (33)
- report (11)
- require (11)
-
require
_ relative (11) - resolve (11)
-
respond
_ to? (11) - result (11)
- rm (22)
-
rm
_ r (11) - rmdir (11)
- rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11) -
rubygems
/ command _ manager (11) -
rubygems
/ commands / build _ command (11) -
rubygems
/ commands / cert _ command (11) -
rubygems
/ commands / check _ command (11) -
rubygems
/ commands / cleanup _ command (11) -
rubygems
/ commands / contents _ command (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ commands / environment _ command (11) -
rubygems
/ commands / fetch _ command (11) -
rubygems
/ commands / generate _ index _ command (11) -
rubygems
/ commands / help _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / lock _ command (11) -
rubygems
/ commands / mirror _ command (11) -
rubygems
/ commands / outdated _ command (11) -
rubygems
/ commands / pristine _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / rdoc _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / server _ command (11) -
rubygems
/ commands / sources _ command (11) -
rubygems
/ commands / specification _ command (11) -
rubygems
/ commands / uninstall _ command (11) -
rubygems
/ commands / unpack _ command (11) -
rubygems
/ config _ file (11) -
safe
_ load (17) -
set
_ encoding _ by _ bom (5) -
set
_ trace _ func (11) - setgid? (22)
- setuid? (22)
-
setup
_ argv (1) - sexp (11)
-
sexp
_ raw (11) - size (22)
- size? (22)
- socket? (22)
-
source
_ location (6) - spawn (44)
- split (22)
- stat (22)
- sticky? (22)
- sub! (11)
- superclass (11)
- symlink (22)
- symlink? (22)
- sync (11)
-
synthesize
_ file _ task (11) - system (24)
- syswrite (11)
- tell (11)
- test (22)
-
test
/ unit (1) - timeout (19)
-
to
_ a (11) -
to
_ ary (11) -
to
_ i (11) -
to
_ path (11) -
to
_ ptr (11) -
to
_ s (22) - tokenize (11)
-
total
_ time (11) - touch (22)
- tracer (11)
- truncate (22)
- tsort (11)
- tty? (11)
- uid (11)
- umask (22)
- un (11)
- unlink (11)
- uptodate? (11)
- utime (11)
-
verbose
_ flag (11) -
verbose
_ flag= (11) -
wait
_ writable (11) -
world
_ readable? (22) -
world
_ writable? (22) - writable? (22)
-
writable
_ real? (11) - write (11)
- zero? (22)
- クラス/メソッドの定義 (11)
- セキュリティモデル (11)
- 制御構造 (11)
- 変数と定数 (11)
- 字句構造 (11)
検索結果
先頭5件
-
File
. lstat(filename) -> File :: Stat (21285.0) -
File.statと同様ですが、シンボリックリンクに関してリンクそのものの 情報を File::Stat として返します。lstat(2) を実装していないシステムでは、File.stat と同じです。
...
File.statと同様ですが、シンボリックリンクに関してリンクそのものの
情報を File::Stat として返します。lstat(2) を実装していないシステムでは、File.stat と同じです。
@param filename ファイル名を表す文字列を指定します。
@ra......ise Errno::EXXX 情報の取得に失敗した場合に発生します。
//emlist[例][ruby]{
# link.rb は t.rb のシンボリックリンク
File.lstat("link.rb") == File.stat("t.rb") # => false
File.stat("link.rb") == File.stat("t.rb") # => true
//}
@see IO#stat, File#lstat... -
File
. fnmatch(pattern , path , flags = 0) -> bool (21252.0) -
ファイル名のパターンマッチ fnmatch(3) を行います。 path が pattern にマッチすれば真を返します。そうでない場合には false を返します。
...?', `[]', `{}' が使用できます。
Dir.glob とは違って `**/' は使用できません。
//emlist[例][ruby]{
%w(foo foobar bar).each {|f|
p File.fnmatch("foo*", f)
}
# => true
# true
# false
//}
@param path パスを表す文字列を指定します。
@param flag......る定数は以下のとおりです。
これらの定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::FNM_NOESCAPE などとして参照可能です。
: FNM_NOES......れます。
//emlist[][ruby]{
p File.fnmatch('\a', 'a') # => true
p File.fnmatch('\a', '\a', File::FNM_NOESCAPE) # => true
//}
前者で * は、エスケープされているので "*" そのものにマッチ
します。
//emlist[][ruby]{
p File.fnmatch('\*', 'a')... -
File
. fnmatch?(pattern , path , flags = 0) -> bool (21252.0) -
ファイル名のパターンマッチ fnmatch(3) を行います。 path が pattern にマッチすれば真を返します。そうでない場合には false を返します。
...?', `[]', `{}' が使用できます。
Dir.glob とは違って `**/' は使用できません。
//emlist[例][ruby]{
%w(foo foobar bar).each {|f|
p File.fnmatch("foo*", f)
}
# => true
# true
# false
//}
@param path パスを表す文字列を指定します。
@param flag......る定数は以下のとおりです。
これらの定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::FNM_NOESCAPE などとして参照可能です。
: FNM_NOES......れます。
//emlist[][ruby]{
p File.fnmatch('\a', 'a') # => true
p File.fnmatch('\a', '\a', File::FNM_NOESCAPE) # => true
//}
前者で * は、エスケープされているので "*" そのものにマッチ
します。
//emlist[][ruby]{
p File.fnmatch('\*', 'a')... -
File
. stat(filename) -> File :: Stat (21247.0) -
filename の情報を含む File::Stat オブジェクトを生成し て返します。
...
filename の情報を含む File::Stat オブジェクトを生成し
て返します。
@param filename ファイル名を表す文字列を指定します。
@raise Errno::EXXX 情報の取得に失敗した場合に発生します。
//emlist[例][ruby]{
File.stat("testfile").class # => Fi......le::Stat
File.stat("testfile").mtime # => 2017-12-10 01:13:56 +0900
//}
@see IO#stat, File#lstat... -
File
. basename(filename , suffix = "") -> String (21244.0) -
filename の一番後ろのスラッシュに続く要素を返します。もし、 引数 suffix が与えられて、かつそれが filename の末尾に 一致するなら、それを取り除いたものを返します。
...
filename の一番後ろのスラッシュに続く要素を返します。もし、
引数 suffix が与えられて、かつそれが filename の末尾に
一致するなら、それを取り除いたものを返します。
//emlist[例][ruby]{
p File.basename("ruby/ruby.c") #=> "ruby......"
p File.basename("ruby/ruby.c", ".c") #=> "ruby"
p File.basename("ruby/ruby.c", ".*") #=> "ruby"
p File.basename("ruby/ruby.exe", ".*") #=> "ruby"
p File.basename("ruby/y.tab.c", ".*") #=> "y.tab"
//}
File.basename の動作は basename(3)
に従います。
//emlist[例][ruby]{
p File.b......asename("foo/bar/") # => "bar"
//}
@param filename ファイル名を表す文字列を指定します。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任... -
File
. new(path , mode = "r" , perm = 0666) -> File (21203.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 (21203.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 (21203.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
. dirname(filename , level=1) -> String (21196.0) -
filename の一番後ろのスラッシュより前を文 字列として返します。スラッシュを含まないファイル名に対しては "."(カレントディレクトリ)を返します。
...
filename の一番後ろのスラッシュより前を文
字列として返します。スラッシュを含まないファイル名に対しては
"."(カレントディレクトリ)を返します。
//emlist[例][ruby]{
p File.dirname("dir/file.ext") # => "dir"
p File.dirname("file.ext")......# => "."
//}
File.dirname の動作は dirname(3)
に従います。
//emlist[例][ruby]{
p File.dirname("foo/bar/") # => "foo"
p File.dirname("foo//bar") # => "foo"
//}
level が指定されたときは、最後のlevel個を取り除いた文字列を返します。
//emlist[leve......lを指定する例][ruby]{
File.dirname("/home/gumby/work/ruby.rb", 2) # => "/home/gumby"
File.dirname("/home/gumby/work/ruby.rb", 4) # => "/"
//}
@param filename ファイル名を表す文字列を指定します。
@param level 末尾からいくつ取り除くかを指定します。
@raise A... -
File
. absolute _ path?(file _ name) -> bool (21171.0) -
file_name が絶対パスなら true を、そうでなければ false を返します。
...
file_name が絶対パスなら true を、そうでなければ false を返します。
@param file_name ファイル名を表す文字列を指定します。文字列でない場合は、to_path メソッド、to_str メソッドの順で暗黙の型変換が試みられます。
@raise TypeE......//emlist[例][ruby]{
File.absolute_path?("//foo/bar\\baz") # => true
File.absolute_path?("C:foo\\bar") # => false
File.absolute_path?("~") # => false
# プラットフォームが cygwin、mswin、mingw の場合
File.absolute_path?("C:\\foo\\bar") # => true
File.absolute_path?......("/foo/bar\\baz") # => false
# プラットフォームが上記以外の場合
File.absolute_path?("C:\\foo\\bar") # => false
File.absolute_path?("/foo/bar\\baz") # => true
//}... -
File
. utime(atime , mtime , *filename) -> Integer (21170.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.lutime と違って、 シンボリックのリンク先を変更します。
...ファイルの最終アクセス時刻と更新時刻を変更します。
シンボリックリンクに対しては File.lutime と違って、
シンボリックのリンク先を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で......定します。
@param filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(201......5, 6)
File.utime(atime, mtime, "testfile") # => 1
File.atime("testfile") # => 2018-01-02 03:04:05 +0900
File.mtime("testfile") # => 2018-02-03 04:05:06 +0900
//}
//emlist[例: 経過秒数で指定][ruby]{
File.utime(1, 2, "testfile") # => 1
File.atime("testfile")...