Professional Web Applications Themes

Marshal format filter? 1.6.8 to 1.8.1 - Ruby

Hi all, I'm in a situation where I may want to have a 1.8.1 client communicate with a 1.6.8 server, where the server is sending back marshal'd data. Is there a way to "filter" a 1.6.8 format into a 1.8.1 format, and vice-versa? Because the Marshal format can change even between minor releases, I think having a filter of some sort like this would be a good thing to have around in general. Or, is this impractical? Regards, Dan...

  1. #1

    Default Marshal format filter? 1.6.8 to 1.8.1

    Hi all,

    I'm in a situation where I may want to have a 1.8.1 client communicate
    with a 1.6.8 server, where the server is sending back marshal'd data.
    Is there a way to "filter" a 1.6.8 format into a 1.8.1 format, and
    vice-versa?

    Because the Marshal format can change even between minor releases, I
    think having a filter of some sort like this would be a good thing to
    have around in general.

    Or, is this impractical?

    Regards,

    Dan



    Berger, Guest

  2. #2

    Default Re: Marshal format filter? 1.6.8 to 1.8.1

    On Thu, 22 Jan 2004, Berger, Daniel wrote:
     

    I'm kind of curious about that, too, as my current Iowa implementation
    relies on Marshal, which means that Iowa servlets have to be running the
    same version of Ruby as the code that is sending a request to them.

    I tried using YAML to do what Marshal is doing, but the last time I tried
    it, under 1.6.8, with an older version of YAML, it was horribly, horribly
    slow, so I reluctantly went back to Marshal.

    This is a tangent, but is YAML any faster than it used to be?

    I have other reasons for not wanting to use Marshal (namely, makes it
    rather difficult to have a Perl CGI or a handler written in C make
    requests to Iowa servlets), so I may have to roll my own task oriented
    communications protocol here, but I don't want to do that just yet if I
    don't have to.


    Thanks,

    Kirk Haines



    Kirk Guest

  3. #3

    Default Re: Marshal format filter? 1.6.8 to 1.8.1

    Hi,

    In message "Marshal format filter? 1.6.8 to 1.8.1"
    on 04/01/22, "Berger, Daniel" <com> writes:

    |I'm in a situation where I may want to have a 1.8.1 client communicate
    |with a 1.6.8 server, where the server is sending back marshal'd data.
    |Is there a way to "filter" a 1.6.8 format into a 1.8.1 format, and
    |vice-versa?

    Simplest filter (should run on 1.8.1):

    Marshal.dump(Marshal.load(STDIN), STDOUT)

    Binary hack:

    open(file, "r+"){|f|
    f.rewind
    f.putc Marshal::MAJOR_VERSION
    f.putc Marshal::MINOR_VERSION
    }

    I recommend you not to convert downward.

    matz.


    Yukihiro Guest

Similar Threads

  1. Marshal.GetActiveObject throws an exception in a C# webservice but
    By OfurGørn in forum ASP.NET Web Services
    Replies: 30
    Last Post: February 17th, 02:47 AM
  2. Ruby 1.8 and Marshal.load/Marshal.dump
    By Michael Davis in forum Ruby
    Replies: 0
    Last Post: October 10th, 10:15 PM
  3. Marshal format "safe"?
    By Ryan Pavlik in forum Ruby
    Replies: 2
    Last Post: August 6th, 05:39 PM
  4. Can't marshal MatchData?
    By Gavin Sinclair in forum Ruby
    Replies: 3
    Last Post: August 6th, 12:20 PM
  5. Marshal efficiency
    By Gavin Sinclair in forum Ruby
    Replies: 2
    Last Post: July 20th, 05:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139