"FileName" (Interpreter Type)

A file that exists on disk.

Details

Allowed Forms

  • A path to an existing file, either wrapped in File or not.

Restriction Specifications

  • Restricted["FileName",format]a file of a given format
    Restricted["FileName",format,max]a file of a given format and size smaller than max bytes
    Restricted["FileName",format,{min,max}]a file of a given format and size between min and max bytes
  • The bounds min and max can also be expressed as quantities in the appropriate unit (e.g. Quantity[1,"Megabytes"]).

Interpretation

Examples

Basic Examples  (1)

Check if a file exists:

Restrict to a file format:

Restrict to all image files:

Restrict to a given size:

Introduced in 2014
 (10.0)