grosser / ruco

Desktop-style, Intuitive, Commandline Editor in Ruby. "Better than nano, simpler than vim."
MIT License
130 stars 10 forks source link

Error Restoring Sessions #4

Closed ajpalkovic closed 13 years ago

ajpalkovic commented 13 years ago

When I edit a file for the first time, ruco works fine. Subsequent edits raise this error: C:/Users/palkovic/Projects/ruco/lib/ruco/file_store.rb:39:in load': dump format error(0x6e) (ArgumentError) from C:/Users/palkovic/Projects/ruco/lib/ruco/file_store.rb:39:indeserialize' from C:/Users/palkovic/Projects/ruco/lib/ruco/file_store.rb:20:in get' from C:/Users/palkovic/Projects/ruco/lib/ruco/editor.rb:69:inrestore_session' from C:/Users/palkovic/Projects/ruco/lib/ruco/editor.rb:32:in initialize' from C:/Users/palkovic/Projects/ruco/lib/ruco/application.rb:260:innew' from C:/Users/palkovic/Projects/ruco/lib/ruco/application.rb:260:in create_components' from C:/Users/palkovic/Projects/ruco/lib/ruco/application.rb:12:ininitialize' from bin/ruco:117:in new' from bin/ruco:117:in

'

I opened the file and pasted it here: http://pastie.org/1880284 github, was eating some of the characters. The first line is what ruco was writing to the file, and the second line is what I got when I marshaled the same object in irb.

I noticed other problems in ruco with the handling of file paths, in particular you were passing paths like C:\ directly to the shell, but they weren't being escaped, so perhaps something like that is going on here?

grosser commented 13 years ago

I never tested ruco on windows, but i think you can fix most(if not all) issues by running the specs(download the project and run rake) and fixing what breaks

ajpalkovic commented 13 years ago

I think I actually fixed that here: https://github.com/ajpalkovic/ruco/commit/958e80ecc647654187f2baf7931ed5fc70e2aa4e On Windows we have to open files in binary mode, but the default (unlike Linux) is to open in text mode, which probably alters the content of the file.