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 placeholder:

  • if placeholder is provided and safe, use it;
  • otherwise, if there is any safe placeholder, use the first;
  • otherwise, if placeholder is provided, use it;
  • finally use placeholder 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 placeholder.

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

Use TYPESAFE_IF_POSSIBLE, provided placeholder is accepted.

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

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