os.TYPESAFE_IF_POSSIBLE

Place file in a typesafe manner if possible, place unsafely otherwise.

Syntax

os.TYPESAFE_IF_POSSIBLE

Description

Place file in a typesafe manner if possible.

Apply the following steps for selecting the bucket:

  • if bucket is provided and safe, use it;
  • otherwise, if there is any safe bucket, use the first;
  • otherwise, if bucket is provided, use it;
  • finally use bucket 0.

See also os.TYPESAFE. The main difference between os.TYPESAFE and os.TYPESAFE_IF_POSSIBLE is how they behave in cases where it is not possilbe to place the file respecting typesafety. os.TYPESAFE will reject the operation. os.TYPESAFE_IF_POSSIBLE will place the file anyway.

Examples

Not using TYPESAFE_IF_POSSIBLE, ignore .Accept rules.

Use TYPESAFE_IF_POSSIBLE, find accepting bucket.

Use TYPESAFE_IF_POSSIBLE, when provided bucket is not accepted, prefer the first accepting bucket.

Use TYPESAFE_IF_POSSIBLE, provided bucket is accepted.

Use TYPESAFE_IF_POSSIBLE, nothing accepted, fall back to using bucket 0.

Use TYPESAFE_IF_POSSIBLE, nothing accepted, fall back to using provided bucket.