7件ヒット
[1-7件を表示]
(0.078秒)
クラス
- Pathname (7)
検索結果
先頭5件
-
Pathname
# utime(atime , mtime) -> Integer (28210.0) -
File.utime(atime, mtime, self.to_s) と同じです。
File.utime(atime, mtime, self.to_s) と同じです。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@see File.utime -
Pathname
# atime -> Time (27610.0) -
File.atime(self.to_s) を渡したものと同じです。
...File.atime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.atime # => 2018-12-18 20:58:13 +0900
//}
@see File.atime... -
Pathname
# birthtime -> Time (27610.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# ctime -> Time (27610.0) -
File.ctime(self.to_s) を渡したものと同じです。
....ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime... -
Pathname
# mtime -> Time (27610.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# relative? -> bool (9028.0) -
self が相対パス指定であれば真を返します。
...self が相対パス指定であれば真を返します。
//emlist[例][ruby]{
require 'pathname'
p = Pathname.new('/im/sure')
p.relative? #=> false
p = Pathname.new('not/so/sure')
p.relative? #=> true
//}... -
Pathname
# root? -> bool (9028.0) -
self がルートディレクトリであれば真を返します。判断は文字列操作によっ て行われ、ファイルシステムはアクセスされません。
...self がルートディレクトリであれば真を返します。判断は文字列操作によっ
て行われ、ファイルシステムはアクセスされません。
//emlist[例][ruby]{
require 'pathname'
Pathname('/').root? # => true
Pathname('/im/sure').root? # => false
//}...