Forum: JRuby chmod in a File block

666badca71c452ae51c999971419b506?d=identicon&s=25 Joe Kutner (Guest)
on 2013-10-22 21:20
(Received via mailing list)
While looking at a CI failure on the rubyzip gem, I found that an error
was generated from a line like this:

File.open("data/generated/empty_chmod640.txt", "w") { |f| f.chmod(0640)
}

The error was: "RuntimeError: No such file or directory -
data/generated/empty_chmod640.txt"

The error was consistent in the test suite, but I was not able to
reproduce it outside of the test suite.  A simple change fixed the
problem:
https://github.com/rubyzip/rubyzip/commit/b6767548...

Could this be a JRuby bug? Are there any known related issues?
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2013-10-22 22:08
(Received via mailing list)
Is it on Windows?  I would think we create the file write away, but
Windows
is really unhappy doing 2 things to one file at the same time.

-Tom
666badca71c452ae51c999971419b506?d=identicon&s=25 Joe Kutner (Guest)
on 2013-10-22 22:11
(Received via mailing list)
No, Mac OS X and Ubuntu (happens on both).  But i couldn't reproduce it
in isolation.  So it works in general.
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles Nutter (headius)
on 2013-10-22 22:59
(Received via mailing list)
Ahh, so that's why it wasn't working :-) I was running into that too.

It sounds like a JRuby bug but I don't know why it would fail that way.

- Charlie
666badca71c452ae51c999971419b506?d=identicon&s=25 Joe Kutner (Guest)
on 2013-10-22 23:14
(Received via mailing list)
This topic is locked and can not be replied to.