do builder; in this case,
        old time stamp is removed from filename and
        a new time stamp is append to the filename
974048
def build_base_filename(self):
        
        if self.stream:
            self.stream.close()
            self.stream = None

        # remove old suffix
        if self.suffix_time != "":
            index = self.baseFilename.find("." + self.suffix_time)
            if index == -1:
                index = self.baseFilename.rfind(".")
            self.baseFilename = self.baseFilename[:index]

        # add new suffix
        current_time_tuple = time.localtime()
        self.suffix_time = time.strftime(self.suffix, current_time_tuple)
        self.baseFilename = self.baseFilename + "." + self.suffix_time

        self.mode = 'a'
        if not self.delay:
            self.stream = self._open()
841885
def write(self, filename=None):
        
        if not filename:
            filename = self.filename

        # update time
        self.properties.CurrentDate = _current_time()

        # set rubber band to true
        self.properties.EnableRubberBand = 'true'

        # update start position
        self.update_start_position()

        # update well postions
        self.update_well_positions()

        # update counts
        self.update_counts()

        # remove py:pytype attributes
        objectify.deannotate(self.root)

        # remove namespaces added by lxml
        for child in self.root.iterchildren():
            etree.cleanup_namespaces(child)

        xml = etree.tostring(self.root, encoding='utf8',
                             xml_declaration=True, pretty_print=True)

        # fix format quirks
        # add carriage return character
        xml = u'\r\n'.join(l.decode(encoding='utf8') for l in xml.splitlines())
        # add space at "end/>" --> "end />"
        xml = re.sub(r'(["a-z])/>', r'\1 />', xml)
        xml = xml.replace("version='1.0' encoding='utf8'", 'version="1.0"')

        with open(filename, 'wb') as f:
            f.write(xml.encode('utf8'))
1291162
public function clearTimestamps()
    {
        $path = $this->path . static::BUILD_TIME_FILE;
        if (file_exists($path)) {
            unlink($this->path . static::BUILD_TIME_FILE);
        }
    }
888335
public function clearBuildTs()
    {
        $this->_io->verbose('Clearing build timestamp.');
        $writer = $this->factory->writer();
        $writer->clearTimestamps();
    }
593628
def timestamp_insert(sender, frames):
        
        for frame in frames:
            timestamp = datetime.now(timezone.utc)
            frame.created = timestamp
            frame.modified = timestamp
791312
def _addFilename(self, filename):
        
        cur = self._connection.cursor()
        try:
            cur.execute('INSERT INTO files(name) VALUES (?)', (filename,))
        except sqlite3.IntegrityError as e:
            if str(e).find('UNIQUE constraint failed') > -1:
                raise ValueError('Duplicate file name: %r' % filename)
            else:
                raise
        else:
            fileNumber = cur.lastrowid
            self._connection.commit()
            return fileNumber
1141890
def replace_in_file(self, file_path, old_exp, new_exp):
        
        self.term.print_info(u"Making replacement into {}"
                                 .format(self.term.text_in_color(file_path,
                                                                 TERM_GREEN)))
        # write the new version into a temporary file
        tmp_file = tempfile.NamedTemporaryFile(mode='w+t', delete=False)
        for filelineno, line in enumerate(io.open(file_path, encoding="utf-8")):
            if old_exp in line:
                line = line.replace(old_exp, new_exp)
            try:
                tmp_file.write(line.encode('utf-8'))
            except TypeError:
                tmp_file.write(line)

        name = tmp_file.name # keep the name
        tmp_file.close()
        shutil.copy(name, file_path) # replace the original one
        os.remove(name)
903654
def time2fname(tstamp, full=False):
    """"""
    result = tstamp.strftime(FILENAME_FORMAT)
    result = result if not full else join(time2dir(tstamp), result)
    return result
1142604
def _on_delete(self, builder):
        
        column = self._get_deleted_at_column(builder)

        return builder.update({column: builder.get_model().fresh_timestamp()})
761045
def archive_if_exists(filename):
    
    if os.path.exists(filename):
        current_time = datetime.datetime.now()
        dt_format = '%Y-%m-%dT%H:%M:%S%z'
        timestamp = current_time.strftime(dt_format)
        dst = filename + '_' + timestamp
        shutil.move(filename, dst)
1268036
function watchChanges() {
  function buildChange(file) {
    log.info('File changed:', file);
    try {
      siteBuilder.buildChange(file);
    } catch (e) {
      log.error('Error building site:', e);
    }
  }

  // TODO: What happens when files/dirs are added?
  var dirs = [];
  siteBuilder.fileMap.files.forEach(function(file) {
    if (file.type === 'dir') {
      dirs.push(file.name);
    }
  });

  watch(dirs, buildChange);
}
13877
private static void appendToBuilder(long l, int radix, StringBuilder builder, char[] bufferConversion)
    {
        if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
        {
            radix = 10;
        }
        if (l == 0)
        {
            builder.append('0');
            return;
        }

        int count = 2;
        long j = l;
        boolean negative = l < 0;
        if (!negative)
        {
            count = 1;
            j = -l;
        }
        while ((l /= radix) != 0)
        {
            count++;
        }

        if (bufferConversion.length < count)
        {
            bufferConversion = new char[count];
        }
        int finalCount = count;

        char[] buffer = bufferConversion;
        do 
        {
            int ch = 0 - (int) (j % radix);
            if (ch > 9)
            {
                ch = ch - 10 + 'a';
            }
            else
            {
                ch += '0';
            }
            buffer[--count] = (char) ch;
            j /= radix;
        }
        while (j != 0);
        if (negative)
        {
            buffer[0] = '-';
        }
        for (int i = 0; i < finalCount; i++)
        {
            builder.append(buffer[i]);
        }
        //return new String(0, buffer.length, buffer);
    }
314077
protected void appendField(final StringBuilder builder, final String key, final LocalDateTime value) {
        appendField(builder, key, DATE_TIME_FORMAT.format(value));
    }
492917
def change_time(self):
    """"""
    timestamp = self._fsntfs_file_entry.get_entry_modification_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
585567
def record_timestamp(pathname_full):
    """"""
    if Settings.test or Settings.list_only or not Settings.record_timestamp:
        return
    if not Settings.follow_symlinks and os.path.islink(pathname_full):
        if Settings.verbose:
            print('Not setting timestamp because not following symlinks')
        return
    if not os.path.isdir(pathname_full):
        if Settings.verbose:
            print('Not setting timestamp for a non-directory')
        return

    record_filename_full = os.path.join(pathname_full, RECORD_FILENAME)
    try:
        with open(record_filename_full, 'w'):
            os.utime(record_filename_full, None)
        if Settings.verbose:
            print("Set timestamp: {}".format(record_filename_full))
        for fname in OLD_TIMESTAMPS:
            if fname.startswith(pathname_full) and \
               fname != record_filename_full:
                # only remove timestamps below the curent path
                # but don't remove the timestamp we just set!
                os.remove(fname)
                if Settings.verbose:
                    print('Removed old timestamp: {}'.format(fname))
    except IOError:
        print("Could not set timestamp in {}".format(pathname_full))
1040007
private long beforeAppend(DecoratedKey decoratedKey)
    {
        assert decoratedKey != null : "Keys must not be null"; // empty keys ARE allowed b/c of indexed column values
        if (lastWrittenKey != null && lastWrittenKey.compareTo(decoratedKey) >= 0)
            throw new RuntimeException("Last written key " + lastWrittenKey + " >= current key " + decoratedKey + " writing into " + getFilename());
        return (lastWrittenKey == null) ? 0 : dataFile.getFilePointer();
    }
186167
public MapBuilder addTimestamp(String fieldName, boolean include, long timestamp) {
        if (include && timestamp > 0) {
            map.put(getFieldName(fieldName), timestampFormatter.format(timestamp));
        }
        return this;
    }