Skip to content

Commit d4e3d70

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Doc for Pathname#atime
1 parent c819029 commit d4e3d70

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

pathname_builtin.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,20 @@ def write(...) File.write(@path, ...) end
10421042
# See File.binwrite.
10431043
def binwrite(...) File.binwrite(@path, ...) end
10441044

1045-
# See <tt>File.atime</tt>. Returns last access time.
1045+
# call-seq:
1046+
# atime -> new_time
1047+
#
1048+
# Returns a new Time object containing the time of the most recent
1049+
# access (read or write) to the entry;
1050+
# via File.atime:
1051+
#
1052+
# pn = Pathname.new('t.tmp')
1053+
# pn.write('foo')
1054+
# pn.atime # => 2026-03-22 13:49:44.5165608 -0500
1055+
# pn.read # => "foo"
1056+
# pn.atime # => 2026-03-22 13:49:57.5359349 -0500
1057+
# pn.delete
1058+
#
10461059
def atime() File.atime(@path) end
10471060

10481061
# Returns the birth time for the file.

0 commit comments

Comments
 (0)