// readIntFromFile reads an int from a file in a pod's directory.
767421
func (p *Pod) readIntFromFile(path string) (i int, err error) {
	b, err := p.readFile(path)
	if err != nil {
		return
	}
	_, err = fmt.Sscanf(string(b), "%d", &i)
	return
}
322327
func ReadFile(filename string) (*File, error) {
	fin, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer fin.Close()

	f := new(File)
	f.Root, err = Parse(fin)
	if err != nil {
		return nil, err
	}

	return f, nil
}
842419
func (b *Builder) ReadFile(path string) (Source, error) {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return Source{}, fmt.Errorf("config: ReadFile failed on %s: %s", path, err)
	}
	return Source{Name: path, Data: string(data)}, nil
}
685063
func ReadFile(path string) ([]byte, error) {
	file, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer Close(file)
	data, err := ioutil.ReadAll(file)
	if err != nil {
		return nil, err
	}
	return data, nil
}
473114
func dataFromSliceOrFile(data []byte, file string) ([]byte, error) {
	if len(data) > 0 {
		return data, nil
	}
	if len(file) > 0 {
		fileData, err := ioutil.ReadFile(file)
		if err != nil {
			return []byte{}, err
		}
		return fileData, nil
	}
	return nil, nil
}
948612
func (ns *Namespace) ReadFile(i interface{}) (string, error) {
	s, err := cast.ToStringE(i)
	if err != nil {
		return "", err
	}

	return readFile(ns.readFileFs, s)
}
215458
func (s *stringFile) ReadFile(ctx context.Context, fi *dokan.FileInfo, bs []byte, offset int64) (int, error) {
	data := s.data
	if offset >= int64(len(data)) {
		return 0, nil
	}

	data = data[int(offset):]

	return copy(bs, data), nil
}
22101
func (f *StandaloneFile) ReadFile() ([]byte, error) {
	return f.filespace.ReadFile(f.path)
}
806828
func ReadUUIDFromFile(path string) (string, error) {
	uuid, err := ioutil.ReadFile(path)
	if err != nil {
		return "", err
	}
	return string(bytes.TrimSpace(uuid)), nil
}
776818
func ReadFile(f string) (*Schema, error) {
	in, err := os.Open(f)
	if err != nil {
		return nil, err
	}
	defer in.Close()
	return Read(in)
}
861063
func ReadFile(filePath string) ([]byte, error) {
	b, err := ioutil.ReadFile(filePath)
	if err != nil {
		return []byte(""), err
	}
	return b, nil
}
898212
func (r *cfgReaderType) ReadFile(s string) ([]byte, error) {
	return ioutil.ReadFile(s)
}
656433
func readPidFile(filename string) (int, error) {
	bs, err := ioutil.ReadFile(filename)
	if err != nil {
		return 0, err
	}

	n, err := strconv.Atoi(strings.TrimSpace(string(bs)))
	if err != nil {
		return 0, err
	}

	return n, nil
}
1030832
func readFile(f *os.File) (testOut []byte) {
	tmp := make([]byte, 256)
	for n, err := f.Read(tmp); err != io.EOF; n, err = f.Read(tmp) {
		testOut = append(testOut, tmp[:n]...)
	}
	return testOut
}
837020
func readIntegerNonEmptyFromReader(r io.Reader, length uint) (uint64, []byte, error) {
	buf := make([]byte, length)
	if err := readBytes(buf, r); err != nil {
		return 0, nil, WithStack(err)
	}
	return readIntegerNonEmpty(buf, length), buf, nil
}
680767
func ReadUintFromFile(path string) (uint64, error) {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return 0, err
	}
	return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
}
132698
func (p *S3Path) ReadFile() ([]byte, error) {
	var b bytes.Buffer
	_, err := p.WriteTo(&b)
	if err != nil {
		return nil, err
	}
	return b.Bytes(), nil
}