Skip to content

Commit a29662d

Browse files
committed
Fix File.utime to return the number of file names in the arguments
1 parent 0e73061 commit a29662d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Compatibility:
3838
* Update `String#rindex` to only accept `Regexp` or objects convertable to `String` as the first parameter (#2608, @bjfish).
3939
* Update `String#<<` to require one argument (#2609, @bjfish).
4040
* Update `String#split` to raise `TypeError` when false is given (#2606, @bjfish).
41+
* Update `File.utime` to return the number of file names in the arguments (#2616, @bjfish).
4142

4243
Performance:
4344

spec/ruby/core/file/utime_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
File.mtime(@file1).nsec.should.between?(0, 123500000)
7878
end
7979

80+
it "returns the number of filenames in the arguments" do
81+
File.utime(@atime.to_f, @mtime.to_f, @file1, @file2).should == 2
82+
end
83+
8084
platform_is :linux do
8185
platform_is wordsize: 64 do
8286
it "allows Time instances in the far future to set mtime and atime (but some filesystems limit it up to 2446-05-10 or 2038-01-19)" do

src/main/ruby/truffleruby/core/file.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@ def self.utime(atime, mtime, *paths)
11161116
mtime.to_i, mtime.nsec)
11171117
Errno.handle unless n == 0
11181118
end
1119+
paths.size
11191120
end
11201121

11211122
def self.world_readable?(path)

0 commit comments

Comments
 (0)