func WaitTillExists(path string, tick, timeout time.Duration) (err error) {
	end := time.Now().Add(timeout)

	if _, err = stat(path); err == nil {
		return
	}

	for time.Now().Before(end) && err != nil {
		time.Sleep(tick)
		_, err = stat(path)
	}

	return
}
// This will wait for the path to exist for a Duration of timeout,
// polling every tick seconds. If the file exists within the timeout
// it will return nil. If not an error will be returned. You can check
// if it is just due to the file not existing by calling os.IsNotExist
This will wait for the path to exist for a Duration of timeout,
polling every tick seconds. If the file exists within the timeout
it will return nil. If not an error will be returned. You can check
if it is just due to the file not existing by calling os.IsNotExist
// This will wait for the path to exist for a Duration of timeout // polling every tick seconds . If the file exists within the timeout // it will return nil . If not an error will be returned . You can check // if it is just due to the file not existing by calling os . IsNotExist
func WaitTillExists(path string, tick, timeout time.Duration) (err error) {
	end := time.Now().Add(timeout)
	if _, err = stat(path); err == nil {
		return
	}
	for time.Now().Before(end) && err != nil {
		time.Sleep(tick)
		_, err = stat(path)
	}
	return
}
func WaitTillExists ( path string , tick , timeout time . Duration ) ( err error ) { end := time . Now ( ) . Add ( timeout ) if _ , err = stat ( path ) ; err == nil { return } for time . Now ( ) . Before ( end ) && err != nil { time . Sleep ( tick ) _ , err = stat ( path ) } return }
This will wait for the path to exist for a Duration of timeout,
polling every tick seconds.
This will wait for the path to exist for a Duration of timeout polling every tick seconds .