// Check if the bucket exists
//
// NB this can return incorrect results if called immediately after bucket deletion
Check if the bucket exists

NB this can return incorrect results if called immediately after bucket deletion
// Check if the bucket exists // // NB this can return incorrect results if called immediately after bucket deletion
func (f *Fs) dirExists() (bool, error) {
	req := s3.HeadBucketInput{
		Bucket: &f.bucket,
	}
	_, err := f.c.HeadBucket(&req)
	if err == nil {
		return true, nil
	}
	if err, ok := err.(awserr.RequestFailure); ok {
		if err.StatusCode() == http.StatusNotFound {
			return false, nil
		}
	}
	return false, err
}
func ( f * Fs ) dirExists ( ) ( bool , error ) { req := s3 . HeadBucketInput { Bucket : & f . bucket , } _ , err := f . c . HeadBucket ( & req ) if err == nil { return true , nil } if err , ok := err . ( awserr . RequestFailure ) ; ok { if err . StatusCode ( ) == http . StatusNotFound { return false , nil } } return false , err }
Check if the bucket exists
Check if the bucket exists