File.stat behaves incorrectly when inspecting files inside of a jar
-------------------------------------------------------------------
Key: JRUBY-4594
URL: http://jira.codehaus.org/browse/JRUBY-4594
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5
Environment: Ubuntu 9.10
Reporter: Jeremy Stephens
Priority: Minor
Fix For: JRuby 1.5
When running File.stat on a file inside of a JAR, the size of the entire JAR is
used instead of the size of the file inside:
{code:title="from the shell"}
java -jar /opt/jruby/lib/jruby-complete.jar -e 'p
File.stat("file:/opt/jruby/lib/jruby-complete.jar!META-INF/MANIFEST.MF").size'
{code}
This causes an issue when running a Sinatra app from within a JAR. When
serving static files, Sinatra gets the Content-Length via File.stat. This
causes clients to the web server to wait for more data, since the
Content-Length is much larger than the size of the actual static file.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email