クラス
-
ARGF
. class (132) - BasicObject (22)
- Binding (17)
- Class (11)
- Dir (234)
- File (883)
-
File
:: Stat (473) - IO (899)
- LoadError (11)
- Object (22)
-
RubyVM
:: InstructionSequence (99) - String (11)
モジュール
-
File
:: Constants (315) - FileTest (292)
-
GC
:: Profiler (88) - Kernel (321)
- Marshal (22)
- Process (11)
-
RubyVM
:: AbstractSyntaxTree (8)
キーワード
-
$ > (11) -
$ FILENAME (11) -
$ stdin (11) -
$ stdout (11) - <=> (11)
-
ALT
_ SEPARATOR (11) - APPEND (11)
- ARGF (11)
- BINARY (11)
- CREAT (11)
- ConditionVariable (9)
- Constants (11)
- DATA (11)
- DIRECT (11)
- DSYNC (11)
- EMFILE (11)
- ENFILE (11)
- EXCL (11)
-
FNM
_ CASEFOLD (11) -
FNM
_ DOTMATCH (11) -
FNM
_ EXTGLOB (11) -
FNM
_ NOESCAPE (11) -
FNM
_ PATHNAME (11) -
FNM
_ SYSCASE (11) - File (11)
- FileTest (11)
- IO (11)
-
LOCK
_ EX (11) -
LOCK
_ NB (11) -
LOCK
_ SH (11) -
LOCK
_ UN (11) - NOATIME (11)
- NOCTTY (11)
- NOFOLLOW (11)
- NONBLOCK (11)
- NULL (11)
-
PATH
_ SEPARATOR (11) - Profiler (11)
- RDONLY (11)
- RDWR (11)
-
RLIMIT
_ NOFILE (11) - RSYNC (11)
- SEPARATOR (11)
-
SHARE
_ DELETE (9) - SYNC (11)
- Separator (11)
- Stat (11)
- TMPFILE (9)
- TRUNC (11)
- Time (11)
- WRONLY (11)
- [] (11)
-
_ _ dir _ _ (11) -
absolute
_ path (22) -
absolute
_ path? (5) - advise (11)
- atime (33)
-
base
_ label (11) - basename (11)
- birthtime (31)
- blksize (11)
- blockdev? (33)
- blocks (11)
- caller (33)
- chardev? (33)
- chmod (22)
- chown (22)
- chroot (11)
- clear (11)
- clone (11)
- close (11)
-
close
_ on _ exec= (11) - closed? (11)
- compile (11)
-
compile
_ file (11) -
compile
_ option= (11) - count (11)
- ctime (33)
- delete (11)
- dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - directory? (33)
- dirname (11)
- disable (11)
- dump (22)
- dup (11)
- each (66)
-
each
_ byte (22) -
each
_ char (22) -
each
_ child (28) -
each
_ codepoint (22) -
each
_ line (66) - empty? (16)
- enable (11)
- enabled? (11)
- entries (11)
- eof (11)
- eof? (11)
- eval (11)
- executable? (33)
-
executable
_ real? (33) - exist? (33)
- exists? (27)
-
external
_ encoding (11) - extname (11)
- fail (33)
- fcntl (11)
- fdatasync (11)
- file? (33)
- filename (11)
- fileno (32)
- flock (11)
- flush (11)
- fnmatch (11)
- fnmatch? (11)
-
for
_ fd (11) - foreach (44)
- ftype (22)
- getbyte (22)
- getc (22)
- gets (44)
- gid (11)
- glob (22)
- grpowned? (33)
- home (22)
- identical? (22)
- ino (11)
-
inplace
_ mode= (11) -
instance
_ eval (22) -
internal
_ encoding (11) - isatty (11)
- join (11)
- label (11)
- lchmod (11)
- lchown (11)
- lineno (22)
- lineno= (11)
- link (11)
- load (11)
- lstat (22)
- lutime (7)
- mkdir (11)
- mkfifo (9)
- mode (11)
- mtime (33)
- new (55)
- nlink (11)
- of (11)
- open (88)
- owned? (33)
-
parse
_ file (8) - path (55)
- pipe? (33)
- pos (11)
- pos= (11)
- pread (7)
- pwrite (7)
- raise (33)
-
raw
_ data (11) - rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) - read (55)
- readable? (33)
-
readable
_ real? (33) - readbyte (22)
- readchar (22)
- readline (44)
- readlines (66)
- readlink (11)
- realdirpath (11)
- realpath (11)
- rename (11)
- reopen (33)
- report (11)
- require (11)
-
require
_ relative (11) -
respond
_ to? (11) - result (11)
- rewind (11)
- seek (11)
-
set
_ encoding (33) -
set
_ encoding _ by _ bom (5) - setgid? (33)
- setuid? (33)
- size (44)
- size? (33)
- socket? (33)
-
source
_ location (6) - spawn (44)
- split (11)
- stat (22)
- sticky? (33)
- superclass (11)
- symlink (11)
- symlink? (33)
- sync (11)
- sysread (11)
- sysseek (11)
- system (24)
- syswrite (11)
- tell (11)
- test (22)
-
to
_ i (22) -
to
_ io (11) -
to
_ path (11) -
total
_ time (11) - truncate (22)
- tty? (11)
- uid (11)
- umask (22)
- ungetbyte (11)
- ungetc (11)
- unlink (11)
- utime (11)
-
world
_ readable? (33) -
world
_ writable? (33) - writable? (33)
-
writable
_ real? (33) - write (11)
- zero? (33)
検索結果
先頭5件
-
ARGF
. class # file -> IO (32243.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が現在開いて......いる処理対象が標準入力の場合、$stdin を返します。... -
File
. file?(path) -> bool (32219.0) -
FileTest.#file? と同じです。
...
FileTest.#file? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
FileTest
. # file?(file) -> bool (26440.0) -
ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...m file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.file?('/bin/bash') # => true
FileTest.file?('/bin') # => false
FileTest.fi......le?('/no_such_file') # => false... -
File
:: Constants :: TMPFILE -> Integer (26218.0) -
名前なしの一時ファイルを作成します。 open(2) で O_TMPFILE が指定できる場合に使えます。 File.openで使用します。
...名前なしの一時ファイルを作成します。
open(2) で O_TMPFILE が指定できる場合に使えます。
File.openで使用します。... -
File
:: Stat # file? -> bool (26215.0) -
通常ファイルの時に真を返します。
...通常ファイルの時に真を返します。
//emlist[][ruby]{
p File::Stat.new($0).file? #=> true
//}... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (23638.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
... file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# i......rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
File
. utime(atime , mtime , *filename) -> Integer (23460.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.lutime と違って、 シンボリックのリンク先を変更します。
...新時刻を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@param filename ファイル名を表す文字列を......raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtime = Time.new(2018, 2, 3, 4, 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") # => 1970-01-01 09:00:01 +0900
File.mtime("testfile") # => 1970-01-01 09:00:02 +0900
//}......リックリンクに対しては File.lutime と違って、
シンボリックのリンク先を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過......m filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtim......ime.new(2018, 2, 3, 4, 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
Fi... -
File
. lutime(atime , mtime , *filename) -> Integer (23424.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.utime と違って、 シンボリックそのものを変更します。
...ボリックリンクに対しては File.utime と違って、
シンボリックそのものを変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒......数を数値で指定します。
@param filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
@see File.utime... -
File
. unlink(*filename) -> Integer (23332.0) -
ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。
...Dir.rmdir を使います。
@param filename ファイル名を表す文字列を指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("......test.txt") # => false
begin
File.delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}... -
File
. ctime(filename) -> Time (23320.0) -
状態が最後に変更された時刻を返します。 状態の変更とは chmod などによるものです。
...aram filename ファイル名を表す文字列か IO オブジェクトを指定します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
File.ctime("testfile") # => 2017-11-30 22:40:49 +0900
File.ch......mod(0755, "testfile")
File.ctime("testfile") # => 2017-11-30 22:42:12 +0900
//}...