Skip to content

Commit bbd1e2f

Browse files
committed
Add Pathname#lutime method
1 parent e575ef6 commit bbd1e2f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Compatibility:
4444
* Do not autosplat a proc that accepts a single positional argument and keywords (#3039, @andrykonchin).
4545
* Support passing anonymous * and ** parameters as method call arguments (#3039, @andrykonchin).
4646
* Handle either positional or keywords arguments by default in `Struct.new` (#3039, @rwstauner).
47-
* Add `File.lutime` method (@andrykonchin).
47+
* Add `File.lutime` and `Pathname#lutime` methods (#3039, @andrykonchin).
4848

4949
Performance:
5050

lib/truffle/pathname.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,10 @@ def truncate(length) File.truncate(@path, length) end
896896
# See <tt>File.utime</tt>. Update the access and modification times.
897897
def utime(atime, mtime) File.utime(atime, mtime, @path) end
898898

899+
# See <tt>File.lutime</tt>. Update the access and modification times.
900+
# Same as Pathname#utime, but does not follow symbolic links.
901+
def lutime(atime, mtime) File.lutime(atime, mtime, @path) end
902+
899903
# See <tt>File.basename</tt>. Returns the last component of the path.
900904
def basename(*args) self.class.new(File.basename(@path, *args)) end
901905

0 commit comments

Comments
 (0)