Skip to content

Commit 647af5a

Browse files
Watson1978claude
andcommitted
Pathname#lutime を追加 (Ruby 3.2)
Pathname#lutime がるりまに未収録だった。File.lutime(atime, mtime, self.to_s) と同じで、Pathname#utime と違いシンボリックリンクそのものの時刻を変更する (リンク先をたどらない)。 実機で登場バージョンを確認した結果、2.7 / 3.1 には存在せず 3.2 で追加された ため #@SInCE 3.2 で分岐した。 既存の Pathname#utime / #lchmod と同じ「File.xxx と同じです」+ #@#noexample の書式に合わせ、Pathname#utime の直後に配置した。 実機でシンボリックリンクを作って確認し、lutime ではリンク自身の時刻だけが 変わりリンク先は変わらないこと、utime ではリンク先が変わることを確認済み。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0f53391 commit 647af5a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

manual/api/pathname.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,23 @@ File.utime(atime, mtime, self.to_s) と同じです。
762762

763763
- **SEE** [m:File.utime]
764764

765+
#@since 3.2
766+
### def lutime(atime, mtime) -> Integer
767+
768+
File.lutime(atime, mtime, self.to_s) と同じです。
769+
770+
[m:Pathname#utime] と違い、シンボリックリンクそのものの時刻を変更します
771+
(リンク先をたどりません)。
772+
773+
- **param** `atime` -- 最終アクセス時刻を [c:Time] か、起算時からの経過秒数を数値で指定します。
774+
775+
- **param** `mtime` -- 更新時刻を [c:Time] か、起算時からの経過秒数を数値で指定します。
776+
777+
#@#noexample File.lutime の例を参照
778+
779+
- **SEE** [m:File.lutime], [m:Pathname#utime]
780+
#@end
781+
765782
### def basename(suffix = "") -> Pathname
766783

767784
Pathname.new(File.basename(self.to_s, suffix)) と同じです。

0 commit comments

Comments
 (0)