-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Error in File.stat #2424
Comments
This is an additional information.
I think handling of the path encoding when accessing the file attributes may be a cause. |
Confirmed in JRuby 9k as well. This should be really be fixed for 9k.pre2. |
Ok, I think I see the problem. We are using _stat64 as our win32 stat call, but we probably should be using _wstat which supports wide characters. There may be a way to make stat64 work properly if we transcode the characters to some appropriate encoding (we we may not be doing by just letting default Java transcoding convert the char[] back to byte[]. I'll see if I can get a jnr-posix change made to add _wstat. |
Yup, that appears to fix it. We will need to patch and release jnr-posix for this. I will make the change there, but we need a release of it and pom.xml bump for 9k.pre2. This may also fix it in 1.7, but I did not test that. 1.7 would need the same jnr-posix upgrade treatment. Tagging @enebo re: jnr-posix lifecycle. |
Reopening since it still needs release, and @enebo may want us to explore fixing it in 1.7.20 as well. |
Yeah definitely. We just need to understand more about our last deployment attempt of jffi or possibly just back off that to get these fixes in under the guise of least risk perhaps. |
I've got the commit to update 1.7 in my local repo and will push shortly, so let's call this fixed. |
Oh all right, let's actually just leave it open until @enebo or I can confirm it on Windows. |
Works on windows with jruby-1_7. Closing. |
I'm using jruby 1.7.17
I tested this code on windows 7.
And I got an error when I set java default encoding utf-8.
The file specified by the variable path exists.
In fact, FileTest.readable? returns true.
And I can also read data from the file.
But File.stat throws an exception.
The text was updated successfully, but these errors were encountered: