# File lib/chef_zero/data_store/raw_file_store.rb, line 90 def set(path, data, *options) if options.include?(:create_dir) FileUtils.mkdir_p(path_to(path[0..-2])) end begin mode = File::WRONLY|File::TRUNC|File::BINARY if options.include?(:create) mode |= File::CREAT end File.open(path_to(path), mode, :internal_encoding => nil) do |file| file.write data end rescue Errno::ENOENT raise DataNotFoundError.new(path) end end