306件ヒット
[301-306件を表示]
(0.070秒)
別のキーワード
クラス
-
ARGF
. class (42) - Array (11)
- Binding (1)
- Class (1)
- Complex (3)
- Dir (1)
- Encoding (1)
-
Encoding
:: Converter (6) -
Encoding
:: InvalidByteSequenceError (2) -
Encoding
:: UndefinedConversionError (5) - Enumerator (2)
- Exception (11)
- File (6)
- Float (3)
- IO (104)
- Integer (3)
- Method (1)
- Module (1)
- NilClass (3)
- Numeric (1)
- Object (2)
- Proc (1)
- Rational (30)
- Regexp (1)
-
RubyVM
:: InstructionSequence (11) - SignalException (2)
- StopIteration (1)
- String (18)
- Symbol (4)
- Thread (8)
-
Thread
:: Backtrace :: Location (7) -
Thread
:: ConditionVariable (3) - Time (2)
- TracePoint (2)
- UnboundMethod (1)
モジュール
- Enumerable (5)
キーワード
- * (1)
- ** (1)
- + (1)
- - (1)
- -@ (1)
-
/ (1) - << (1)
- <=> (1)
- == (2)
-
abort
_ on _ exception (1) -
abort
_ on _ exception= (1) - abs (1)
-
absolute
_ path (2) - advise (1)
- atime (1)
- autoclose= (1)
- autoclose? (1)
- backtrace (1)
-
backtrace
_ locations (3) -
base
_ label (2) - binmode (2)
- binmode? (2)
- broadcast (1)
- bytes (2)
- capitalize (2)
- capitalize! (1)
- cause (1)
- ceil (1)
- chars (2)
- chr (1)
- chunk (1)
- clone (1)
- close (1)
-
close
_ on _ exec= (1) -
close
_ on _ exec? (1) -
close
_ read (1) -
close
_ write (1) - closed? (2)
- codepoints (2)
- coerce (1)
- combination (2)
- convert (1)
- ctime (1)
- denominator (1)
-
destination
_ encoding (3) -
destination
_ encoding _ name (2) - disasm (1)
- disassemble (1)
- display (1)
- downcase (2)
- downcase! (1)
- dummy? (1)
- dup (1)
- each (10)
-
each
_ byte (4) -
each
_ char (4) -
each
_ codepoint (2) -
each
_ line (10) - encode (3)
- encode! (2)
- eof (2)
- eof? (2)
-
error
_ char (1) - eval (1)
- exception (2)
-
external
_ encoding (2) - fcntl (1)
- fdatasync (1)
- fdiv (1)
- file (1)
- fileno (2)
-
first
_ lineno (1) - flock (1)
- floor (1)
- flush (1)
- fsync (1)
- getbyte (1)
- getc (1)
- gets (6)
- hash (1)
- inspect (4)
-
instruction
_ sequence (1) -
internal
_ encoding (2) - ioctl (1)
- isatty (1)
- label (2)
-
last
_ error (1) - lineno (2)
- lineno= (1)
- lines (6)
- lstat (1)
- magnitude (1)
-
marshal
_ dump (1) -
module
_ function (1) - mtime (1)
- negative? (1)
- next (1)
-
next
_ values (1) - numerator (1)
- pack (2)
- partition (3)
- path (2)
- permutation (2)
- pid (1)
- pos (2)
- pos= (2)
- positive? (1)
- pread (1)
-
primitive
_ convert (4) - print (1)
- printf (1)
- priority (1)
- priority= (1)
- putc (1)
- puts (1)
- pwrite (1)
- quo (2)
-
raised
_ exception (1) - rationalize (9)
- read (2)
-
read
_ nonblock (2) - readbyte (1)
- readchar (1)
- readline (3)
- readlines (6)
- readpartial (2)
- reopen (3)
-
repeated
_ combination (2) -
repeated
_ permutation (2) -
report
_ on _ exception (1) -
report
_ on _ exception= (1) - result (1)
- rewind (1)
- round (1)
- rpartition (1)
- seek (2)
-
set
_ backtrace (1) -
set
_ encoding (6) - signal (1)
- signm (1)
- signo (1)
-
slice
_ before (2) -
source
_ encoding (1) -
source
_ encoding _ name (1) -
source
_ location (4) - stat (1)
- subsec (1)
- superclass (1)
- swapcase (2)
- swapcase! (1)
- sync (1)
- sync= (1)
- sysread (1)
- sysseek (1)
- syswrite (1)
- tell (2)
-
to
_ a (4) -
to
_ binary (1) -
to
_ f (1) -
to
_ i (2) -
to
_ io (3) -
to
_ r (7) -
to
_ s (3) -
to
_ write _ io (1) - truncate (2)
- tty? (1)
- ungetbyte (1)
- ungetc (1)
- union (1)
- unpack (1)
- upcase (2)
- upcase! (1)
- wait (1)
- write (2)
-
write
_ nonblock (1)
検索結果
先頭5件
-
File
# atime -> Time (28.0) -
最終アクセス時刻を Time オブジェクトとして返します。
最終アクセス時刻を Time オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@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
# ctime -> Time (28.0) -
状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。
@raise IOError 自身が close されている場合に発生します。
@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, F... -
File
# mtime -> Time (28.0) -
最終更新時刻を Time オブジェクトとして返します。
最終更新時刻を Time オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@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 -
File
# truncate(length) -> 0 (28.0) -
ファイルのサイズを最大 length バイトにします。
ファイルのサイズを最大 length バイトにします。
サイズの変更に成功すれば 0 を返します。失敗した場合は例外
Errno::EXXX が発生します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX サイズの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5... -
Object
# display(out = $ stdout) -> nil (28.0) -
オブジェクトを out に出力します。
オブジェクトを out に出力します。
以下のように定義されています。
//emlist[][ruby]{
class Object
def display(out = $stdout)
out.write self
nil
end
end
//}
@param out 出力先のIOオブジェクトです。指定しない場合は標準出力に出力されます。
@return nil を返します。
//emlist[][ruby]{
Object.new.display #=> #<Object:0xbb0210>
//}
@see $stdout -
String
# chr -> String (28.0) -
self の最初の文字だけを含む文字列を返します。
self の最初の文字だけを含む文字列を返します。
//emlist[例][ruby]{
a = "abcde"
a.chr #=> "a"
//}
Ruby 1.9 で IO#getc の戻り値が Integer から String を返すように変更になりました。
Ruby 1.8 以前と1.9以降の互換性を保つために String#chr が存在します。
例:
# ruby 1.8 系では STDIN.getc が 116 を返すため Integer#chr が呼び出される
$ echo test | ruby -e "p STDIN.getc.chr" # => ...