03 May 2012, 17:29
Generic-user-small

pragmatic601guy (1 post)

Working my way through the first exercise in the book and I’ve hit a problem. The contents of new-inventory.txt are this:

exercise-differences.rb inventory.rb new-inventory.txt old-inventory.txt recycler recycler/inst-39.tmp snapshots snapshots/differences-version-1.rb snapshots/differences-version-2.rb snapshots/differences-version-3.rb snapshots/differences-version-4.rb snapshots/differences-version-5.rb snapshots/differences-version-6.rb snapshots/differences-version-7.rb snapshots/differences-version-8.rb temp temp/inst-39

The output of ~~~ File.open(‘new-inventory.txt’).readlines ~~~ is this: > [“\xFF\xFEe\x00x\x00e\x00r\x00c\x00i\x00s\x00e\x00-\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00.\x00r\ 00b\x00\n”, “\x00\n”, “\x00i\x00n\x00v\x00e\x00n\x00t\x00o\x00r\x00y\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00n\x00e\x00w\ 00-\x00i\x00n\x00v\x00e\x00n\x00t\x00o\x00r\x00y\x00.\x00t\x00x\x00t\x00\n”, “\x00\n”, “\x00o\x00l\x00d\x00-\x00i\x00n\ 00v\x00e\x00n\x00t\x00o\x00r\x00y\x00.\x00t\x00x\x00t\x00\n”, “\x00\n”, “\x00r\x00e\x00c\x00y\x00c\x00l\x00e\x00r\x00\n , “\x00\n”, “\x00r\x00e\x00c\x00y\x00c\x00l\x00e\x00r\x00/\x00i\x00n\x00s\x00t\x00-\x003\x009\x00.\x00t\x00m\x00p\x00\n , “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\ 00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\x001\x00.\ 00r\x00b\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\ 00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\x002\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\ 00s\x00h\x00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\ 00n\x00-\x003\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\ 00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\x004\x00.\x00r\x00b\x00\n”, “\x00\n”, “\ 00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\ 00r\x00s\x00i\x00o\x00n\x00-\x005\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00/\ 00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\x006\x00.\x00r\x00b\ 00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\x00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\ 00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\x007\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00s\x00n\x00a\x00p\x00s\x00h\ 00o\x00t\x00s\x00/\x00d\x00i\x00f\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00-\x00v\x00e\x00r\x00s\x00i\x00o\x00n\x00-\ 008\x00.\x00r\x00b\x00\n”, “\x00\n”, “\x00t\x00e\x00m\x00p\x00\n”, “\x00\n”, “\x00t\x00e\x00m\x00p\x00/\x00i\x00n\x00s\ 00t\x00-\x003\x009\x00\n”, “\x00\n”, “\x00”]

I am running irb in cmd.exe, Win7, Ruby 1.9.3 for these exercises.

Have you run into this before?

Thanks!

  You must be logged in to comment