Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > marshal error with nom ascii chars

Reply
Thread Tools

marshal error with nom ascii chars

 
 
Marcelo Cavaco
Guest
Posts: n/a
 
      10-27-2009
first. sorry about my english. i dont speak english very well.

please, someone help me...

i have an array with 2 colums.

ex: myfiles[1] = name of file
myfiles[2] = text of file

i used marshal.dump in this array.

later... i try use marshal.load

ex:

line 1 - scbase = File.open(source, 'rb') { |f| Marshal.load f }
line 2 - scbase.each do |script|
line 3 - myfiles[1].gsub! ':', ' '
line 4 - path = folder + myfiles[1] + '.txt'
line 5 - myfiles_text = Zlib::Inflate.inflate(myfiles[2])
line 6 - File.open(path, 'wb') {|file| file.write(myfiles_text) }
line 7 - end

if the second line of array contain a file name with non asciii char,
the loop dont work.

when the line 4 is executed, the next loop is executed.

ex:

if the array contains 3 files:

1 = test
2 = test * number 2
3 = another test

the line 2 is ignored and only 2 files is created.

but there is no error.

I thought to replace * with _ before the line 5.

but the loop is aborted before. in line 4.

any ideas?

please, help-me.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marshal erro with non ascii chars Marcelo Cavaco Ruby 3 10-28-2009 04:07 PM
marshal.dumps quadratic growth and marshal.dump not allowingfile-like objects bkustel@gmail.com Python 10 06-18-2008 12:52 PM
Regex with ASCII and non-ASCII chars TOXiC Python 5 01-31-2007 04:48 PM
Ruby 1.8 and Marshal.load/Marshal.dump Michael Davis Ruby 0 10-10-2003 10:15 PM
nom de plume (false name)? Beowulf Digital Photography 7 09-01-2003 03:10 AM



Advertisments