code: def copyto_file_path(self, query, path, append=False):
          
          file_mode = 'wb' if not append else 'ab'
          with open(path, file_mode) as f:
              self.copyto_file_object(query, f)
docs: Gets data from a table into a writable file
  
          :param query: The "COPY { table_name [(column_name[, ...])] | (query) }
                             TO STDOUT [WITH(option[,...])]" query to execute
          :type query: str
  
          :param path: A path to a writable file
          :type path: str
  
          :param append: Whether to append or not if the file already exists
                         Default value is False
          :type append: bool
  
          :raise CartoException: