1867件ヒット
[1-100件を表示]
(0.254秒)
ライブラリ
- ビルトイン (1867)
クラス
-
ARGF
. class (144) - BasicObject (24)
- Binding (19)
- Class (12)
- Dir (23)
- File (143)
-
File
:: Stat (504) - IO (862)
- LoadError (12)
- Method (26)
- Object (12)
- Proc (14)
-
RubyVM
:: InstructionSequence (48) - String (12)
モジュール
- Enumerable (12)
キーワード
- << (14)
- <=> (12)
- >> (14)
-
absolute
_ path (12) - advise (12)
- atime (24)
-
base
_ label (12) - birthtime (23)
- blksize (12)
- blockdev? (12)
- blocks (12)
- chardev? (12)
- chmod (12)
- chown (12)
- chunk (12)
- clone (12)
- close (12)
-
close
_ on _ exec= (12) - closed? (12)
- count (12)
- ctime (24)
- dev (12)
-
dev
_ major (12) -
dev
_ minor (12) - directory? (12)
- dup (12)
- each (72)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ line (72) - eof (12)
- eof? (12)
- eval (12)
- executable? (12)
-
executable
_ real? (12) -
external
_ encoding (12) - fcntl (12)
- fdatasync (12)
- file? (12)
- filename (12)
- fileno (35)
- flock (12)
- flush (12)
- ftype (12)
- getbyte (24)
- getc (24)
- gets (36)
- gid (12)
- grpowned? (12)
- ino (12)
-
inplace
_ mode= (12) -
instance
_ eval (24) -
internal
_ encoding (12) - isatty (12)
- label (12)
- lineno (24)
- lineno= (12)
- lstat (12)
- mode (12)
- mtime (24)
- nlink (12)
- owned? (12)
- parameters (12)
- path (48)
- pipe? (12)
- pos (12)
- pos= (12)
- pread (8)
- pwrite (8)
- rdev (12)
-
rdev
_ major (12) -
rdev
_ minor (12) - read (24)
- readable? (12)
-
readable
_ real? (12) - readbyte (24)
- readchar (24)
- readline (36)
- readlines (36)
- reopen (36)
-
respond
_ to? (12) - rewind (12)
- seek (12)
-
set
_ encoding (36) -
set
_ encoding _ by _ bom (6) - setgid? (12)
- setuid? (12)
- size (24)
- size? (12)
- socket? (12)
-
source
_ location (7) - stat (12)
- sticky? (12)
- superclass (12)
- symlink? (12)
- sync (12)
- sysread (12)
- sysseek (12)
- syswrite (12)
- tell (12)
-
to
_ i (24) -
to
_ io (12) -
to
_ path (12) - truncate (12)
- tty? (12)
- uid (12)
- ungetbyte (12)
- ungetc (12)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (12)
- zero? (12)
検索結果
先頭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...