// Listen starts the listen loop
Listen starts the listen loop
// Listen starts the listen loop
func (f *File) Listen() (err error) {
	defer func() {
		f.Stop()
	}()
	if strings.HasPrefix(f.uri, "file://") {
		filename := strings.Replace(f.uri, "file://", "", 1)
		f.filehandle, err = os.Create(filename)
		if err != nil {
			f.pipe.Err <- adaptor.NewError(adaptor.CRITICAL, f.path, fmt.Sprintf("Can't open output file (%s)", err.Error()), nil)
			return err
		}
	}
	return f.pipe.Listen(f.dumpMessage, regexp.MustCompile(`.*`))
}
func ( f * File ) Listen ( ) ( err error ) { defer func ( ) { f . Stop ( ) } ( ) if strings . HasPrefix ( f . uri , " " ) { filename := strings . Replace ( f . uri , " " , " " , 1 ) f . filehandle , err = os . Create ( filename ) if err != nil { f . pipe . Err <- adaptor . NewError ( adaptor . CRITICAL , f . path , fmt . Sprintf ( " " , err . Error ( ) ) , nil ) return err } } return f . pipe . Listen ( f . dumpMessage , regexp . MustCompile ( `.*` ) ) }
Listen starts the listen loop
Listen starts the listen loop