# File lib/chef_zero/data_store/raw_file_store.rb, line 67 def create(path, name, data, *options) if options.include?(:create_dir) FileUtils.mkdir_p(path_to(path)) end begin File.open(path_to(path, name), File::WRONLY|File::CREAT|File::EXCL|File::BINARY, :internal_encoding => nil) do |file| file.write data end rescue Errno::ENOENT raise DataNotFoundError.new(path) rescue Errno::EEXIST raise DataAlreadyExistsError.new(path + [name]) end end