// File copies a single file from src to dst
File copies a single file from src to dst
// File copies a single file from src to dst
func file(src, dst string) error {
	var err error
	var sourceFile *os.File
	var destinationFile *os.File
	var srcinfo os.FileInfo
	if sourceFile, err = os.Open(src); err != nil {
		return err
	}
	defer sourceFile.Close()
	if destinationFile, err = os.Create(dst); err != nil {
		return err
	}
	defer destinationFile.Close()
	if _, err = io.Copy(destinationFile, sourceFile); err != nil {
		return err
	}
	if srcinfo, err = os.Stat(src); err != nil {
		return err
	}
	return os.Chmod(dst, srcinfo.Mode())
}
func file ( src , dst string ) error { var err error var sourceFile * os . File var destinationFile * os . File var srcinfo os . FileInfo if sourceFile , err = os . Open ( src ) ; err != nil { return err } defer sourceFile . Close ( ) if destinationFile , err = os . Create ( dst ) ; err != nil { return err } defer destinationFile . Close ( ) if _ , err = io . Copy ( destinationFile , sourceFile ) ; err != nil { return err } if srcinfo , err = os . Stat ( src ) ; err != nil { return err } return os . Chmod ( dst , srcinfo . Mode ( ) ) }
File copies a single file from src to dst
File copies a single file from src to dst