1708件ヒット
[1-100件を表示]
(0.300秒)
ライブラリ
- ビルトイン (1708)
クラス
-
ARGF
. class (132) - BasicObject (22)
- Binding (17)
- Class (11)
- Dir (21)
- File (131)
-
File
:: Stat (462) - IO (789)
- LoadError (11)
- Method (23)
- Object (11)
- Proc (12)
-
RubyVM
:: InstructionSequence (44) - String (11)
モジュール
- Enumerable (11)
キーワード
- << (12)
- <=> (11)
- >> (12)
-
absolute
_ path (11) - advise (11)
- atime (22)
-
base
_ label (11) - birthtime (21)
- blksize (11)
- blockdev? (11)
- blocks (11)
- chardev? (11)
- chmod (11)
- chown (11)
- chunk (11)
- clone (11)
- close (11)
-
close
_ on _ exec= (11) - closed? (11)
- count (11)
- ctime (22)
- dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - directory? (11)
- dup (11)
- each (66)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (22) -
each
_ line (66) - eof (11)
- eof? (11)
- eval (11)
- executable? (11)
-
executable
_ real? (11) -
external
_ encoding (11) - fcntl (11)
- fdatasync (11)
- file? (11)
- filename (11)
- fileno (32)
- flock (11)
- flush (11)
- ftype (11)
- getbyte (22)
- getc (22)
- gets (33)
- gid (11)
- grpowned? (11)
- ino (11)
-
inplace
_ mode= (11) -
instance
_ eval (22) -
internal
_ encoding (11) - isatty (11)
- label (11)
- lineno (22)
- lineno= (11)
- lstat (11)
- mode (11)
- mtime (22)
- nlink (11)
- owned? (11)
- parameters (11)
- path (44)
- pipe? (11)
- pos (11)
- pos= (11)
- pread (7)
- pwrite (7)
- rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) - read (22)
- readable? (11)
-
readable
_ real? (11) - readbyte (22)
- readchar (22)
- readline (33)
- readlines (33)
- reopen (33)
-
respond
_ to? (11) - rewind (11)
- seek (11)
-
set
_ encoding (33) -
set
_ encoding _ by _ bom (5) - setgid? (11)
- setuid? (11)
- size (22)
- size? (11)
- socket? (11)
-
source
_ location (6) - stat (11)
- sticky? (11)
- superclass (11)
- symlink? (11)
- sync (11)
- sysread (11)
- sysseek (11)
- syswrite (11)
- tell (11)
-
to
_ i (22) -
to
_ io (11) -
to
_ path (11) - truncate (11)
- tty? (11)
- uid (11)
- ungetbyte (11)
- ungetc (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
- zero? (11)
検索結果
先頭5件
-
ARGF
. class # file -> IO (26142.0) -
現在開いている処理対象の File オブジェクト(または IO オブジェ クト)を返します。
...開いている処理対象の File オブジェクト(または IO オブジェ
クト)を返します。
$ echo "foo" > foo
$ echo "bar" > bar
$ ruby argf.rb foo bar
ARGF.file # => #<File:foo>
ARGF.read(5) # => "foo\nb"
ARGF.file # => #<File:bar>
ARGFが現在開いて... -
File
# lstat -> File :: Stat (17148.0) -
ファイルの状態を含む File::Stat オブジェクトを生成して返します。 シンボリックリンクに関してリンクそのものの情報を返します。 lstat(2) を実装していないシステムでは、IO#statと同じです。
...ファイルの状態を含む File::Stat オブジェクトを生成して返します。
シンボリックリンクに関してリンクそのものの情報を返します。
lstat(2) を実装していないシステムでは、IO#statと同じです。
@raise Errno::EXXX 失敗した場合......ose されている場合に発生します。
//emlist[例][ruby]{
# testlink は testfile のシンボリックリンク
File.open("testlink") do |f|
p f.lstat == File.stat("testfile") # => false
p f.stat == File.stat("testfile") # => true
end
//}
@see IO#stat, File.stat, File.lstat... -
File
# flock(operation) -> 0 | false (17121.0) -
ファイルをロックします。
...をロックします。
ロックを取得するまでブロックされます。
ロックの取得に成功した場合は 0 を返します。
File::LOCK_NB (ノンブロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すよう......eration に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参照可能です。
: LOCK_SH
共......ブロックモード。
File::LOCK_SH | File::LOCK_NB のように他の指定と or することで指
定します。この指定がない場合、ブロックされる条件での flock
の呼び出しはロックが解除されるまでブロックされます。
File::LOCK_NB の指定が... -
File
:: Stat # file? -> bool (17114.0) -
通常ファイルの時に真を返します。
...通常ファイルの時に真を返します。
//emlist[][ruby]{
p File::Stat.new($0).file? #=> true
//}... -
File
# path -> String (17043.0) -
オープン時に使用したパスを文字列で返します。
...Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/......tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
File
# to _ path -> String (17043.0) -
オープン時に使用したパスを文字列で返します。
...Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/......tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
File
# path -> String (17037.0) -
オープン時に使用したパスを文字列で返します。
...、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::R......DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}... -
File
# to _ path -> String (17037.0) -
オープン時に使用したパスを文字列で返します。
...、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::R......DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}... -
File
# atime -> Time (17031.0) -
最終アクセス時刻を Time オブジェクトとして返します。
...に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime, File#birthtime... -
File
# birthtime -> Time (17031.0) -
作成された時刻を Time オブジェクトとして返します。
...::EXXX ファイルの時刻の取得に失敗した場合に発生します。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
@see File#lstat, File#atime, File#ctime, File#mtime... -
File
# ctime -> Time (17031.0) -
状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
...に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#mtime, File#birthtime... -
File
# mtime -> Time (17031.0) -
最終更新時刻を Time オブジェクトとして返します。
...に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#atime, File#ctime, File#birthtime...