File.truncate no longer elongate file
-------------------------------------

                 Key: JRUBY-963
                 URL: http://jira.codehaus.org/browse/JRUBY-963
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.0RC2
         Environment: Windows XP / Java 1.6.0
            Reporter: Peter K Chan


path = "new_file"
File.truncate(path, 10)
puts "Size is: " + File.size(path).to_s

In JRuby 1.0 RC2:
Size is: 0

In previous release:
Size is: 10

According to RubyDoc, File.truncate should:

"Truncates the file file_name to be at most integer bytes long. Not available 
on all platforms."

No patch is attached, since the current JRuby behaviour is still correct, given 
the documentation. However, if need be, the previous behavior can be restored 
by using java.io.RandomAccessFile.setLength(), instead of the NIO's 
setLength(), which does not elongate files.

-- 
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

Reply via email to