// DumpFile dumps data to the file
180438
func (l *Ledis) DumpFile(path string) error {
	f, err := os.Create(path)
	if err != nil {
		return err
	}
	defer f.Close()

	return l.Dump(f)
}
220072
func (s Store) LoadFile(filename string) error {
	buf, err := ioutil.ReadFile(filename)
	if err != nil {
		return err
	}

	return Decode(s, buf)
}
1106174
func (column *ColumnInfo) Dump(buffer []byte) []byte {
	buffer = dumpLengthEncodedString(buffer, []byte("def"))
	buffer = dumpLengthEncodedString(buffer, []byte(column.Schema))
	buffer = dumpLengthEncodedString(buffer, []byte(column.Table))
	buffer = dumpLengthEncodedString(buffer, []byte(column.OrgTable))
	buffer = dumpLengthEncodedString(buffer, []byte(column.Name))
	buffer = dumpLengthEncodedString(buffer, []byte(column.OrgName))

	buffer = append(buffer, 0x0c)

	buffer = dumpUint16(buffer, column.Charset)
	buffer = dumpUint32(buffer, column.ColumnLength)
	buffer = append(buffer, dumpType(column.Type))
	buffer = dumpUint16(buffer, dumpFlag(column.Type, column.Flag))
	buffer = append(buffer, column.Decimal)
	buffer = append(buffer, 0, 0)

	if column.DefaultValue != nil {
		buffer = dumpUint64(buffer, uint64(len(column.DefaultValue)))
		buffer = append(buffer, column.DefaultValue...)
	}

	return buffer
}
366504
func ToFile(path string) (*DebugPrinter, error) {
	file, err := os.Create(path)
	if err != nil {
		return nil, err
	}

	return &DebugPrinter{
		out: file,
	}, nil
}
1178003
func readFile(inputFile string) ([]byte, error) {
	inputData, err := ioutil.ReadFile(inputFile)
	if err != nil {
		return nil, fmt.Errorf("reading data from file failed: %v", err)
	}

	return inputData, nil
}
754835
func Dump(data []byte) string {
	var buf bytes.Buffer
	dumper := Dumper(&buf)
	dumper.Write(data)
	dumper.Close()
	return buf.String()
}
1095150
func (s Store) WriteFile(filename string) error {
	buf, err := s.Bytes()
	if err != nil {
		return err
	}

	return ioutil.WriteFile(filename, buf, 0600)
}
920817
func (s *DbSession) SaveFile(file File, prefix string) (string, error) {
	f, err := s.gridFS(prefix).Create(file.Name)
	if err != nil {
		return "", err
	}

	f.SetContentType(file.ContentType)
	_, err = f.Write(file.Data)
	if err != nil {
		return "", err
	}
	defer f.Close()

	fileID := f.Id().(bson.ObjectId)

	return fileID.Hex(), nil
}
882538
func loadFile(path string, overload bool) error {
	env, err := ReadFile(path)
	if err != nil {
		return err
	}
	LoadMap(env, overload)
	return nil
}
1169504
func Dump(file string, v interface{}) error {
	b, err := Marshal(v)
	if err != nil {
		return err
	}

	return ioutil.WriteFile(file, b, 0644)
}
549582
func (s *NFSBackup) Dump(dest io.Writer) (err error) {
	err = s.Caller.Execute(dest, s.getDumpCommand())
	return
}
413347
func DumpToString(i interface{}) string {
	buf := new(bytes.Buffer)
	Dump(buf, i)
	return buf.String()
}
918791
func (f *SyncFromServerFile) WriteFile(ctx context.Context, fi *dokan.FileInfo, bs []byte, offset int64) (n int, err error) {
	f.folder.fs.logEnter(ctx, "SyncFromServerFile Write")
	defer func() { f.folder.reportErr(ctx, libkbfs.WriteMode, err) }()
	if len(bs) == 0 {
		return 0, nil
	}
	folderBranch := f.folder.getFolderBranch()
	if folderBranch == (data.FolderBranch{}) {
		// Nothing to do.
		return len(bs), nil
	}
	err = f.folder.fs.config.KBFSOps().SyncFromServer(
		ctx, folderBranch, nil)
	if err != nil {
		return 0, err
	}
	f.folder.fs.NotificationGroupWait()
	return len(bs), nil
}
753610
func NewFile() (file *File) {
	file = &File{}
	file.Sheet = make(map[string]*Sheet)
	file.Sheets = make([]*Sheet, 0)
	return
}
228464
func (l *Ledis) LoadDumpFile(path string) (*DumpHead, error) {
	f, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	return l.LoadDump(f)
}
475946
func (c *Context) ServeFile(w http.ResponseWriter, req *http.Request, name string) {
	root := &httpFS{c, name}
	http.FileServer(root).ServeHTTP(w, req)
}
1169024
func (i *IniParser) WriteFile(filename string, options IniOptions) error {
	return writeIniToFile(i, filename, options)
}