Skip to content

utime behaviour different from MRI #4710

@gioele

Description

@gioele

The following code works as expected in MRI, but fails in JRuby 9.1.9.0.

F = '/tmp/test'
File.open(F, 'w') {} # "touch" the file
mtime = File.mtime(F)
File.utime(Time.now, 0, F)
File.mtime(F).to_i == 0 or raise "mtime should be 0"

File.utime(Time.now, mtime, F)
File.mtime(F).to_i == mtime.to_i or raise "File.mtime should be == mtime"

Found while testing the filepath gem via Travis-CI. The log is available at https://travis-ci.org/gioele/filepath/jobs/251546194

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions