"FileName" (interpreter type)

Checks if a file exists on disk.

DetailsDetails

  • "FileName" can be used in Interpreter and related constructs, including deployed smart form fields.
  • Use of "FileName" does not require connectivity to the Wolfram Cloud.

Allowed FormsAllowed Forms

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

Restriction SpecificationsRestriction 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"]).

InterpretationInterpretation

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Check if a file exists:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Restrict to a file format:

In[3]:=
Click for copyable input
Out[3]=

Restrict to all image files:

In[4]:=
Click for copyable input
Out[4]=

Restrict to a given size:

In[5]:=
Click for copyable input
Out[5]=