Skip to contents

Resolves one versioned object in cloud storage. When version = "latest", returns the most recently updated object matching the prefix and extension.

Usage

cloud_object_name(
  prefix,
  version = "latest",
  extension = "",
  provider,
  exact_match = FALSE,
  options
)

Arguments

prefix

A character string specifying the file prefix.

version

A character string specifying the version. Default is "latest".

extension

A character string specifying the file extension.

provider

A character string specifying the cloud storage provider.

exact_match

A logical value indicating whether to match prefix exactly.

options

A named list of cloud storage provider options.

Value

A character string with the full object name, or character(0) if no matching objects are found.

Resolves one object, never enumerates a bucket

This function is not a listing helper. It always returns a single name — selected_rows$name[1] — even though it groups internally by base_name and ext. Point it at a prefix that matches many distinct base names (for example one object per GPS trip, where tens of thousands share a prefix) and it silently hands back an arbitrary one of them rather than erroring. It is built for the versioned-snapshot pattern <prefix>__<version>__.<ext>, where the prefix identifies exactly one logical dataset and the only question is which version of it to take.

To enumerate objects, use cloud_object_names(), which returns every match.

The single-name return type is depended upon by downstream pipelines and will not change.

See also

cloud_object_names() for enumeration.