Appends msg onto the Given File
547440
def append_onto_file(self, file_name, msg):
        
        with open(file_name, "a") as heart_file:
            heart_file.write(msg)
            heart_file.close()
1225579
public static void append(File file, Object text) throws IOException {
        Writer writer = null;
        try {
            writer = new FileWriter(file, true);
            InvokerHelper.write(writer, text);
            writer.flush();

            Writer temp = writer;
            writer = null;
            temp.close();
        } finally {
            closeWithWarning(writer);
        }
    }
325094
def log(self, msg):
        '''
        '''
        if self.logfile:
            fd = self.logfile.fileno()
        else:
            fd = sys.stdout.fileno()

        os.write(fd, ('%.3f %s\n' % (time.time(), msg)).encode('UTF-8'))
1060086
def append_text(self, txt):
        
        with open(self.fullname, "a") as myfile:
            myfile.write(txt)
572126
def append_message(self, text, output_format=OutputFormat.NormalMessageFormat):
        
        self._append_message(text, self._formats[output_format])
916497
def append_line(filename, **line):
    
    global lock

    data = json.dumps(line, separators=(',', ':')) + '\n'
    with lock:
        with file(filename, 'a') as fp:
            fp.seek(0, SEEK_END)
            fp.write(data)
793638
def _add_message_file(arg_parser, help_text):
    
    arg_parser.add_argument('--msg-file',
                            type=argparse.FileType('r'),
                            help=help_text)
51805
def _append_object(self, value, _file):
        
        _labs = ' {'
        _file.write(_labs)
        self._tctr += 1

        for (_item, _text) in value.items():
            _tabs = '\t' * self._tctr
            _cmma = ',' if self._vctr[self._tctr] else ''
            _keys = '{cmma}\n{tabs}"{item}" :'.format(cmma=_cmma, tabs=_tabs, item=_item)
            _file.write(_keys)

            self._vctr[self._tctr] += 1

            _text = self.object_hook(_text)
            _type = type(_text).__name__
            _MAGIC_TYPES[_type](self, _text, _file)

        self._vctr[self._tctr] = 0
        self._tctr -= 1
        _tabs = '\t' * self._tctr
        _labs = '\n{tabs}{}'.format('}', tabs=_tabs)
        _file.write(_labs)
95229
def sp_msg(cmd, pipe=None, data=None):
    """"""
    msg = [SP_HEADER, cmd]
    if pipe is not None:
        msg.append(pipe)
    if data is not None:
        msg.append(data)
    return msg
1270070
def add_message(self, text, type=None):
        """"""
        key = self._msg_key
        self.setdefault(key, [])
        self[key].append(message(type, text))
        self.save()
149103
def append_line(self, new_line):
        """"""
        # TODO: The user still has to write the raw line, this is error prone.
        self._write(('PGM', [Integer, String]), self.idx, new_line)
752366
def append(self, box):
        
        if self._codec_format == opj2.CODEC_J2K:
            msg = "Only JP2 files can currently have boxes appended to them."
            raise IOError(msg)

        if not ((box.box_id == 'xml ') or
                (box.box_id == 'uuid' and
                 box.uuid == UUID('be7acfcb-97a9-42e8-9c71-999491e3afac'))):
            msg = ("Only XML boxes and XMP UUID boxes can currently be "
                   "appended.")
            raise IOError(msg)

        # Check the last box.  If the length field is zero, then rewrite
        # the length field to reflect the true length of the box.
        with open(self.filename, 'rb') as ifile:
            offset = self.box[-1].offset
            ifile.seek(offset)
            read_buffer = ifile.read(4)
            box_length, = struct.unpack('>I', read_buffer)
            if box_length == 0:
                # Reopen the file in write mode and rewrite the length field.
                true_box_length = os.path.getsize(ifile.name) - offset
                with open(self.filename, 'r+b') as ofile:
                    ofile.seek(offset)
                    write_buffer = struct.pack('>I', true_box_length)
                    ofile.write(write_buffer)

        # Can now safely append the box.
        with open(self.filename, 'ab') as ofile:
            box.write(ofile)

        self.parse()
901965
def log_to_file(self, message):
        """"""

        with self.build_fs.open(self.log_file, 'a+') as f:
            f.write(unicode(message + '\n'))
1002642
def write(self, log_file, msg):
        
        try:
            with open(log_file, 'a') as LogFile:
                LogFile.write(msg + os.linesep)
        except:
            raise Exception('Error Configuring PyLogger.TextStorage Class.')

        return os.path.isfile(log_file)
552404
def add_file(self, name="", hashalg="", hash="", comClasses=None, 
                 typelibs=None, comInterfaceProxyStubs=None, 
                 windowClasses=None):
        
        self.files.append(File(name, hashalg, hash, comClasses, 
                          typelibs, comInterfaceProxyStubs, windowClasses))
564066
private static function _writeLog($filename, $msg, $addTime = true)
    {
        // preppend details
        if($addTime) {
            $msg = self::formatHeaderWithTime() . $msg;
        }

        if(DI::has('BufferOptions')) {

            $options = DI::get('BufferConnectionOptions');

            $callback = function($data) use ($filename) {
                Writer::writeLogVerbose($filename, implode("\n\n", $data) . "\n\n");
            };

            // just to be on safe side, set max size to 500, that is reasonable number
            $maxSize = 500;

            $size = isset($options['size']) && is_int($options['size']) && $options['size'] > 0 && $options['size'] < $maxSize
                ? $options['size']
                : $maxSize;

            $buffer = new Buffer($filename, Buffer::ADAPTER_REDIS, $size, $callback, $options);
            $buffer->add($msg);

        } else {
            Writer::writeLogVerbose($filename, $msg);
        }
    }
922336
static function append_file($file_path_and_name, $file_content, $overwrite = false)
    {
        echo ("Appending the file: ".$file_path_and_name.PHP_EOL);
        if ($overwrite) {
            file_put_contents($file_path_and_name, $file_content);
        } else {
            file_put_contents($file_path_and_name, $file_content, FILE_APPEND);
        }
    }