Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File modification time not properly set #5533

Closed
cshupp1 opened this Issue Dec 20, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@cshupp1
Copy link

commented Dec 20, 2018

This might be a windows only issue (Windows 10).

Consider the following portion of a directory listing:

-rw-r--r-- 1 cshupp 197121   0 Aug 26 21:03 uts_dif.log.age

Now consider the following irb:

$ java -jar C:\Users\cshupp\Downloads\jruby-complete-9.2.5.0.jar -Sjirb
irb(main):001:0> a = 'uts_dif.log.age'
=> "uts_dif.log.age"
irb(main):002:0> require 'fileutils'
=> true
irb(main):003:0> FileUtils.touch a
=> ["uts_dif.log.age"]

Note the touch did not change mtime.

-rw-r--r-- 1 cshupp 197121   0 Aug 26 21:03 uts_dif.log.age

Now consider this irb session:

java -jar C:\Users\cshupp\Downloads\jruby-complete-9.1.10.0.jar -Sjirb
irb(main):001:0> require 'fileutils
irb(main):005:0> a = 'uts_dif.log.age'
=> "uts_dif.log.age"
irb(main):006:0> FileUtils.touch a
=> ["uts_dif.log.age"]

Note the slightly older JRuby works as expected:

-rw-r--r-- 1 cshupp 197121   0 Dec 20 13:54 uts_dif.log.age

MRI Ruby behaves as 9.1.10.

My logging framework is utterly broken...

@ahorek

This comment has been minimized.

Copy link
Contributor

commented Dec 27, 2018

slightly reduced to
File.utime(nil, nil, 'testfile')
it should update mtime, but it doesn't on windows

this works fine
File.utime(Time.now, Time.now, 'testfile')

@ahorek

This comment has been minimized.

Copy link
Contributor

commented Dec 27, 2018

it's actually related to this change jnr/jnr-posix#107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.