func (f *Fs) CopyFile(src string, dst string) error {
	srcFile, err := f.AferoFs.Open(src)
	if err != nil {
		return errors.Wrap(err, "open src file")
	}
	defer srcFile.Close()

	srcInfo, err := srcFile.Stat()
	if err != nil {
		return errors.Wrap(err, "stat src file")
	}

	dstFile, err := f.AferoFs.OpenFile(dst, os.O_RDWR|os.O_CREATE, srcInfo.Mode())
	if err != nil {
		return errors.Wrap(err, "open dst file")
	}
	defer dstFile.Close()

	if _, err = io.Copy(dstFile, srcFile); err != nil {
		return errors.Wrap(err, "copy file")
	}

	return nil
}
// CopyFile copies the specified file to the the given destination.
CopyFile copies the specified file to the the given destination.
// CopyFile copies the specified file to the the given destination .
func (f *Fs) CopyFile(src string, dst string) error {
	srcFile, err := f.AferoFs.Open(src)
	if err != nil {
		return errors.Wrap(err, "open src file")
	}
	defer srcFile.Close()
	srcInfo, err := srcFile.Stat()
	if err != nil {
		return errors.Wrap(err, "stat src file")
	}
	dstFile, err := f.AferoFs.OpenFile(dst, os.O_RDWR|os.O_CREATE, srcInfo.Mode())
	if err != nil {
		return errors.Wrap(err, "open dst file")
	}
	defer dstFile.Close()
	if _, err = io.Copy(dstFile, srcFile); err != nil {
		return errors.Wrap(err, "copy file")
	}
	return nil
}
func ( f * Fs ) CopyFile ( src string , dst string ) error { srcFile , err := f . AferoFs . Open ( src ) if err != nil { return errors . Wrap ( err , " " ) } defer srcFile . Close ( ) srcInfo , err := srcFile . Stat ( ) if err != nil { return errors . Wrap ( err , " " ) } dstFile , err := f . AferoFs . OpenFile ( dst , os . O_RDWR | os . O_CREATE , srcInfo . Mode ( ) ) if err != nil { return errors . Wrap ( err , " " ) } defer dstFile . Close ( ) if _ , err = io . Copy ( dstFile , srcFile ) ; err != nil { return errors . Wrap ( err , " " ) } return nil }
CopyFile copies the specified file to the the given destination.
CopyFile copies the specified file to the the given destination .