Permalink
Browse files

fixed bug on windows with marshalling not reading/writing binary

git-svn-id: http://bundle-fu.googlecode.com/svn/trunk@12 1db77ec0-6337-0410-9320-454da9aca44f
  • Loading branch information...
1 parent ff1183c commit e9eb36a291e860ac0a3411ce34f01b0ef6f032b7 timcharper committed Aug 11, 2007
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/bundle_fu/file_list.rb
@@ -28,7 +28,9 @@ def update_mtimes
def self.open(filename)
return nil unless File.exists?(filename)
b = new
- b.filelist = Marshal.load(File.read(filename))
+ File.open(filename, "rb") {|f|
+ b.filelist = Marshal.load(f) # rescue [])
+ }
b
end
@@ -47,7 +49,7 @@ def add_files(filenames=[])
end
def save_as(filename)
- File.open(filename, "w") {|f| f.puts Marshal.dump(self.filelist)}
+ File.open(filename, "wb") {|f| f.puts Marshal.dump(self.filelist)}
end
protected
def abs_location(filename)

0 comments on commit e9eb36a

Please sign in to comment.