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 size error on windows #770

Closed
pickerel opened this issue May 26, 2013 · 3 comments
Closed

file size error on windows #770

pickerel opened this issue May 26, 2013 · 3 comments
Labels
Milestone

Comments

@pickerel
Copy link

@pickerel pickerel commented May 26, 2013

It's my test code: test.rb

f = File.new("test.txt", "a")
p f.size

when i executed it with ruby 1.9.3p125, i got the result:
c:\test>ruby export.rb
0

but when i executed it with jruby 1.7.4 (1.9.3p392), i got the result:
c:\test>jruby export.rb
SystemCallError: Unknown error - Unknown Error (20047) - -1
size at org/jruby/RubyFile.java:1081
(root) at export.rb:2

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Sep 14, 2013

I have a hunch that this may be related to #547.

@keeguon
Copy link

@keeguon keeguon commented Nov 21, 2013

As @BanzaiMan mentioned it I created the ticket #1240 with the same issue what's the status on this...?

@enebo
Copy link
Member

@enebo enebo commented Nov 27, 2013

I changed the impl of size to use a different mechanism for determing size. This should work as well as File.stat.size does so I am assuming it will fix the problem here. fwiw, the original test case in this bug did not error for me when I started working on this but #1272 uncovered a second problem with jnr-posix fstat impl. Speculatively closing. Re-open if you have a problem still.

@enebo enebo closed this Nov 27, 2013
jayjlawrence added a commit to jayjlawrence/jruby that referenced this issue Dec 4, 2013
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
4 participants