marshal question

C

Christophe Mckeon

hi,

is there some character or sequence of characters which is guaranteed
*not* to occur in a string produced by Marshal.dump on some arbitrary
object hierarchy.

thanks,
_c
 
J

Joel VanderWerf

Christophe said:
hi,

is there some character or sequence of characters which is guaranteed
*not* to occur in a string produced by Marshal.dump on some arbitrary
object hierarchy.

Think not. If you do:

result = Marshal.dump(some_sequence_of_characters)

then the characters of the string some_sequence_of_characters are going
to be embedded in the result string.

For example:

irb(main):001:0> Marshal.dump("1234")
=> "\004\b\"\t1234"
irb(main):002:0> Marshal.dump("\001\002\003\004")
=> "\004\b\"\t\001\002\003\004"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,055
Latest member
RacheleCar

Latest Threads

Top