#NEWLINE# def get_contents_to_filename( self , filename , headers = None , cb = None , num_cb = 10 , torrent = False , version_id = None , res_download_handler = None , response_headers = None ) : #NEWLINE# #INDENT# "\n        Retrieve an object from S3 using the name of the Key object as the\n        key in S3.  Store contents of the object to a file named by 'filename'.\n        See get_contents_to_file method for details about the\n        parameters.\n\n        :type filename: string\n        :param filename: The filename of where to put the file contents\n\n        :type headers: dict\n        :param headers: Any additional headers to send in the request\n\n        :type cb: function\n        :param cb: a callback function that will be called to report\n                   progress on the upload.  The callback should accept\n                   two integer parameters, the first representing the\n                   number of bytes that have been successfully\n                   transmitted to S3 and the second representing the\n                   size of the to be transmitted object.\n\n        :type cb: int\n        :param num_cb: (optional) If a callback is specified with\n                       the cb parameter this parameter determines the\n                       granularity of the callback by defining\n                       the maximum number of times the callback will\n                       be called during the file transfer.\n\n        :type torrent: bool\n        :param torrent: If True, returns the contents of a torrent file\n                        as a string.\n\n        :type res_upload_handler: ResumableDownloadHandler\n        :param res_download_handler: If provided, this handler will\n                                     perform the download.\n\n        :type response_headers: dict\n        :param response_headers: A dictionary containing HTTP headers/values\n                                 that will override any headers associated with\n                                 the stored object in the response.\n                                 See http://goo.gl/EWOPb for details.\n        " #NEWLINE# fp = open ( filename , 'wb' ) #NEWLINE# self . get_contents_to_file ( fp , headers , cb , num_cb , torrent = torrent , version_id = version_id , res_download_handler = res_download_handler , response_headers = response_headers ) #NEWLINE# fp . close ( ) #NEWLINE# if ( self . last_modified != None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# modified_tuple = rfc822 . parsedate_tz ( self . last_modified ) #NEWLINE# modified_stamp = int ( rfc822 . mktime_tz ( modified_tuple ) ) #NEWLINE# os . utime ( fp . name , ( modified_stamp , modified_stamp ) ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# pass