# File lib/puppet/util/filetype.rb, line 224 224: def write(text) 225: puts text 226: require "tempfile" 227: output_file = Tempfile.new("puppet") 228: fh = output_file.open 229: fh.print text 230: fh.close 231: 232: # We have to chown the stupid file to the user. 233: File.chown(Puppet::Util.uid(@path), nil, output_file.path) 234: 235: begin 236: Puppet::Util.execute(["crontab", output_file.path], :uid => @path) 237: rescue => detail 238: raise Puppet::Error, "Could not write crontab for #{@path}: #{detail}" 239: end 240: output_file.delete 241: end