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.stat("someunavailable").mtime returns odd result #3448

Closed
slackfan opened this issue Nov 6, 2015 · 5 comments
Closed

File.stat("someunavailable").mtime returns odd result #3448

slackfan opened this issue Nov 6, 2015 · 5 comments
Labels
Milestone

Comments

@slackfan
Copy link

@slackfan slackfan commented Nov 6, 2015

Hi,

path = 'bananarama'
mtime = path && File.stat(path).mtime rescue nil
puts mtime
puts mtime.class

In JRuby-9.0.1.0 the result is what I would expect


NilClass

In JRuby-9.0.3.0 the result is a "random (?)" date in the future

2016-02-11 18:23:35 +0100
Time

This breaks e.g. Rubygems because the check for a newer gem on the gem server fails because an unavailable gem is recognized as newer than the gem on the gem server. (RemoteFetcher.cache_update_path)

@enebo enebo added the windows label Nov 6, 2015
@enebo enebo added this to the JRuby 9.0.5.0 milestone Nov 6, 2015
@enebo enebo added this to the JRuby 9.0.4.0 milestone Nov 6, 2015
@enebo enebo removed this from the JRuby 9.0.5.0 milestone Nov 6, 2015
@enebo
Copy link
Member

@enebo enebo commented Nov 6, 2015

I am going to assume you are on Windows right? I can see this on Windows but not MacOS and I did in fact completely replace our old stat impl on Windows to use native Windows APIs instead of posix compat stat impl (this was to support long paths and UNC paths). This should not be too hard to figure out and you saved me having to put out a 9.0.5 quickly after 4 :)

@slackfan
Copy link
Author

@slackfan slackfan commented Nov 6, 2015

Yes, this happens on Windows (7, 2008r2 server, 2012 server). Forgot to mention that :)

@enebo
Copy link
Member

@enebo enebo commented Nov 6, 2015

@slackfan Fixed locally so this will be in 9.0.4.

@slackfan
Copy link
Author

@slackfan slackfan commented Nov 6, 2015

Thank you!

@enebo
Copy link
Member

@enebo enebo commented Nov 12, 2015

This has been fixed a few days. Not sure which commit but it is done. Closing.

@enebo enebo closed this Nov 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants