// WriteRuntime writes the runtime information into the path
165256
func WriteRuntime(path, runtime string) error {
	return ioutil.WriteFile(filepath.Join(path, "runtime"), []byte(runtime), 0600)
}
755296
func (d *DiskProvider) Writer(path ...string) (io.WriteCloser, error) {
	return osutils.SafeCreate(path...)
}
1320003
func (s *LocalState) writeLockInfo(info *LockInfo) error {
	path := s.lockInfoPath()
	info.Path = s.Path
	info.Created = time.Now().UTC()

	err := ioutil.WriteFile(path, info.Marshal(), 0600)
	if err != nil {
		return fmt.Errorf("could not write lock info for %q: %s", s.Path, err)
	}
	return nil
}
1264599
func (t Time) WriteTo(w Writer) error {
	bytes, err := time.Time(t).MarshalBinary()
	if err != nil {
		return errorsp.WithStacks(err)
	}
	return errorsp.WithStacks(ByteSlice(bytes).WriteTo(w))
}
1110829
func (s *Server) ConfigTime() time.Time {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.configTime
}
1088036
func (fi *darwinExFileInfo) ATime() time.Time {
	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atimespec)
}
963088
func parseTime(t string) (time.Time, error) {
	for _, tf := range timeFormats {
		time, err := time.Parse(tf, t)
		if err == nil {
			log.Debug("timeparse: found format", tf)
			return time, nil
		}
	}
	return time.Time{}, ErrInvalidTimeFormat
}
815559
func (p *FSPath) WriteTo(out io.Writer) (int64, error) {
	f, err := os.Open(p.location)
	if err != nil {
		return 0, err
	}
	defer try.CloseFile(f)

	return io.Copy(out, f)
}
396958
func (l *WAL) LastWriteTime() time.Time {
	l.mu.RLock()
	defer l.mu.RUnlock()
	return l.lastWriteTime
}
659793
func (r *Run) RequestedAtTime() (time.Time, error) {
	return time.Parse(time.RFC3339, r.RequestedAt)
}
1205331
func writeLog(writer io.Writer, params LogFormatterParams) {
	buf := buildCommonLogLine(params.Request, params.URL, params.TimeStamp, params.StatusCode, params.Size)
	buf = append(buf, '\n')
	writer.Write(buf)
}
473388
func (p *AssetPath) WriteTo(out io.Writer) (int64, error) {
	data, err := p.ReadFile()
	if err != nil {
		return 0, err
	}
	n, err := out.Write(data)
	return int64(n), err
}
1198788
func (fi *winExFileInfo) CTime() time.Time {
	creationTime := fi.Sys().(syscall.Win32FileAttributeData).CreationTime
	n := creationTime.Nanoseconds()
	return time.Unix(0, n)
}
498976
func Writable(path string) error {
	// Construct the path if missing
	if err := os.MkdirAll(path, os.ModePerm); err != nil {
		return err
	}
	// Check the directory is writable
	if f, err := os.Create(filepath.Join(path, "._check_writable")); err == nil {
		f.Close()
		os.Remove(f.Name())
	} else {
		return errors.New("'" + path + "' is not writable")
	}
	return nil
}
1318695
func WriteFileFromReaderWithModTime(ctx context.Context, bs blobserver.StatReceiver, filename string, modTime time.Time, r io.Reader) (blob.Ref, error) {
	if strings.Contains(filename, "/") {
		return blob.Ref{}, fmt.Errorf("schema.WriteFileFromReader: filename %q shouldn't contain a slash", filename)
	}

	m := NewFileMap(filename)
	if !modTime.IsZero() {
		m.SetModTime(modTime)
	}
	return WriteFileMap(ctx, bs, m, r)
}
521865
func (fs *Filespace) Writer(subPath string) (filesystem.Writer, error) {
	return os.OpenFile(fs.path+subPath, os.O_WRONLY|os.O_CREATE, filesystem.DefaultUnixFileMode)
}
404517
func (s ServiceInfo) WriteFile(path string, log logger.Logger) error {
	out, err := json.MarshalIndent(s, "", "  ")
	if err != nil {
		return err
	}

	file := NewFile(path, []byte(out), 0644)
	return file.Save(log)
}