// Open returns an io.ReadCloser that can be used to read the file's contents.
345495
func (f *File) Open() (io.ReadCloser, error) {
	return f.img.wim.resourceReader(&f.offset)
}
483853
func (s *Stream) Open() (io.ReadCloser, error) {
	return s.wim.resourceReader(&s.offset)
}
1117968
func (c *Client) Open(path string) (*File, error) {
	return c.open(path, flags(os.O_RDONLY))
}
475062
func (f *LogFile) Open() error {
	if err := f.open(); err != nil {
		f.Close()
		return err
	}
	return nil
}
811636
func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) {
	var dgst digest.Digest
	if rf, ok := f.resource.(continuity.RegularFile); ok {
		digests := rf.Digests()
		if len(digests) > 0 {
			dgst = digests[0]
		}
	}
	// TODO(dmcgowan): else check if device can be opened for read
	r, err := f.provider.Open(f.resource.Path(), dgst)
	if err != nil {
		logrus.Debugf("Error opening handle: %v", err)
		return nil, err
	}
	return &fileHandler{
		reader: r,
	}, nil

}
1193232
func (h *fs) Open(filename string) (io.ReadCloser, error) {
	return os.Open(filename)
}
210313
func (self *FileHandler) Open() error {
	var file *os.File
	var err error
	for {
		file, err = os.OpenFile(
			self.filepath, os.O_WRONLY|os.O_CREATE|self.mode, 0666)
		if err == nil {
			break
		}
		// try to create all the parent directories for specified log file
		// if it doesn't exist
		if os.IsNotExist(err) {
			err2 := os.MkdirAll(filepath.Dir(self.filepath), 0755)
			if err2 != nil {
				return err
			}
			continue
		}
		return err
	}
	stream := NewFileStream(file, self.bufferSize)
	self.StreamHandler.SetStream(stream)
	return nil
}
821107
func (r *Reader) Open() {
	if !r.enabled {
		return
	}
	r.runMu.Lock()
	defer r.runMu.Unlock()
	if r.isOpen {
		return
	}

	log.Info("Beginning heartbeat reads")
	r.pool.Open(r.dbconfigs.AppWithDB(), r.dbconfigs.DbaWithDB(), r.dbconfigs.AppDebugWithDB())
	r.ticks.Start(func() { r.readHeartbeat() })
	r.isOpen = true
}
89379
func (s *Server) Open(l int) *Client {
	c := NewClient(l)
	c.Attach(s)
	return c
}
40765
func (fp FsPath) Open() (ReadCloser, error) {
	return fp.Fs.Open(fp.Path)
}
748606
func (s3Select *S3Select) Open(getReader func(offset, length int64) (io.ReadCloser, error)) error {
	switch s3Select.Input.format {
	case csvFormat:
		rc, err := getReader(0, -1)
		if err != nil {
			return err
		}

		s3Select.progressReader, err = newProgressReader(rc, s3Select.Input.CompressionType)
		if err != nil {
			return err
		}

		s3Select.recordReader, err = csv.NewReader(s3Select.progressReader, &s3Select.Input.CSVArgs)
		if err != nil {
			return err
		}

		return nil
	case jsonFormat:
		rc, err := getReader(0, -1)
		if err != nil {
			return err
		}

		s3Select.progressReader, err = newProgressReader(rc, s3Select.Input.CompressionType)
		if err != nil {
			return err
		}

		s3Select.recordReader = json.NewReader(s3Select.progressReader, &s3Select.Input.JSONArgs)
		return nil
	case parquetFormat:
		var err error
		s3Select.recordReader, err = parquet.NewReader(getReader, &s3Select.Input.ParquetArgs)
		return err
	}

	panic(fmt.Errorf("unknown input format '%v'", s3Select.Input.format))
}
532369
func Open(filename string) (image.Image, error) {
	f, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	img, _, err := image.Decode(f)
	if err != nil {
		return nil, err
	}

	return img, nil
}
1373507
func (c *Client) Open(name string) (*FileReader, error) {
	info, err := c.getFileInfo(name)
	if err != nil {
		return nil, &os.PathError{"open", name, interpretException(err)}
	}

	return &FileReader{
		client: c,
		name:   name,
		info:   info,
		closed: false,
	}, nil
}
129951
func Open(fs Filesystem, name string) (File, error) {
	return fs.OpenFile(name, os.O_RDONLY, 0)
}
991810
func (e *Engine) Open() error {
	e.initTrackers()

	if err := os.MkdirAll(e.path, 0777); err != nil {
		return err
	}

	if err := e.cleanup(); err != nil {
		return err
	}

	if err := e.WAL.Open(); err != nil {
		return err
	}

	if err := e.FileStore.Open(); err != nil {
		return err
	}

	if err := e.reloadCache(); err != nil {
		return err
	}

	e.Compactor.Open()

	if e.enableCompactionsOnOpen {
		e.SetCompactionsEnabled(true)
	}

	return nil
}
804485
func (c *Config) Open(logger log.Logger) (storage.Storage, error) {
	return New(logger), nil
}
1321972
func (i *item) Open() (io.ReadCloser, error) {
	_, r, err := i.bucket.DownloadFileByName(i.name)
	return r, err
}