jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3944

[1.9] IO should handle options :binmode and :textmode

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: JRuby 1.4
  • Fix Version/s: None
  • Component/s: HelpWanted, Intro, Ruby 1.9.2
  • Labels:
    None

Description

Right now the code is commented in RubyIO.java:3524 because I don't know how ruby 1.9 handles these options

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Thomas E Enebo added a comment - 05/Jan/10 3:53 PM

As David points out...This is partially implemented, but commented out in RubyIO.java. The work neccesary to fix this is to audit Ruby 1.9 source code and figure out how to hook up and process these options.

Show
Thomas E Enebo added a comment - 05/Jan/10 3:53 PM As David points out...This is partially implemented, but commented out in RubyIO.java. The work neccesary to fix this is to audit Ruby 1.9 source code and figure out how to hook up and process these options.
Hide
Permalink
Martin Harriman added a comment - 07/Oct/11 2:08 AM

I can finish this work.

The MRI 1.9 behavior for :binmode and :textmode:

If either (or both) of these keys are present, with a truthy value, they are equivalent to the 'b' or 't' characters in the mode string, respectively, except for the error raised. Setting both 'b' and 't' in the mode string raises an argument error for "invalid access mode %s" (where %s is the mode string). If both binmode and textmode are requested through the hash keys, possibly in combination with the mode string, the argument error message text is "both textmode and binmode specified".

The mode string is parsed first, so if you set 'b' and 't' there you get the "invalid access mode" message text in the exception, and the values in the hash do not matter.

Except for the message in the exception, :binmode is exactly equivalent to mode 'b' and :textmode is exactly equivalent to mode 't'.

Show
Martin Harriman added a comment - 07/Oct/11 2:08 AM I can finish this work. The MRI 1.9 behavior for :binmode and :textmode: If either (or both) of these keys are present, with a truthy value, they are equivalent to the 'b' or 't' characters in the mode string, respectively, except for the error raised. Setting both 'b' and 't' in the mode string raises an argument error for "invalid access mode %s" (where %s is the mode string). If both binmode and textmode are requested through the hash keys, possibly in combination with the mode string, the argument error message text is "both textmode and binmode specified". The mode string is parsed first, so if you set 'b' and 't' there you get the "invalid access mode" message text in the exception, and the values in the hash do not matter. Except for the message in the exception, :binmode is exactly equivalent to mode 'b' and :textmode is exactly equivalent to mode 't'.
Hide
Permalink
Martin Harriman added a comment - 07/Oct/11 2:08 AM - edited

(double post, curse this browser)

Show
Martin Harriman added a comment - 07/Oct/11 2:08 AM - edited (double post, curse this browser)
Hide
Permalink
Charles A. Lanahan added a comment - 13/Dec/11 11:15 PM

Is this still unresolved? I went hunting for the sections mentioned but no comment exists there anymore?

Show
Charles A. Lanahan added a comment - 13/Dec/11 11:15 PM Is this still unresolved? I went hunting for the sections mentioned but no comment exists there anymore?
Hide
Permalink
Hiro Asari added a comment - 13/Dec/11 11:46 PM - edited

Charles,

As far as I know, this is still unresolved. The comment David mentions is still there; just not on the same lines. https://github.com/jruby/jruby/blob/21ea42097e89c3a70c2971b1209fb39410d6b975/src/org/jruby/RubyIO.java#L4061-4079

By the way, you can look at what commits are made to a file up until a certain date. For example:

git log --until={2009/09/03} src/org/jruby/RubyIO.java
Show
Hiro Asari added a comment - 13/Dec/11 11:46 PM - edited Charles, As far as I know, this is still unresolved. The comment David mentions is still there; just not on the same lines. https://github.com/jruby/jruby/blob/21ea42097e89c3a70c2971b1209fb39410d6b975/src/org/jruby/RubyIO.java#L4061-4079 By the way, you can look at what commits are made to a file up until a certain date. For example:
git log --until={2009/09/03} src/org/jruby/RubyIO.java
Hide
Permalink
Charles Oliver Nutter added a comment - 05/Jan/12 5:53 PM

It looks like Hiro merged in a commit from Martin to handle binmode, at least, in 601a0f65c77ad37b5440c9983eb8f0d2b42d9643, which I merged to jruby-1_6 just now. textmode is still outstanding, I believe.

Show
Charles Oliver Nutter added a comment - 05/Jan/12 5:53 PM It looks like Hiro merged in a commit from Martin to handle binmode, at least, in 601a0f65c77ad37b5440c9983eb8f0d2b42d9643, which I merged to jruby-1_6 just now. textmode is still outstanding, I believe.

People

  • Assignee:
    Unassigned
    Reporter:
    David Calavera
Vote (0)
Watch (2)

Dates

  • Created:
    02/Sep/09 1:59 PM
    Updated:
    05/Jan/12 5:53 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.