This resource function is obsolete. Use the built-in symbol FileFormatQ instead.

Function Repository Resource:

FileFormatQ

Source Notebook

Test if a file is in the specified format

Contributed by: Wolfram Staff

ResourceFunction["FileFormatQ"][file,format]

gives True if file is in the specified format and gives False otherwise.

Details and Options

In ResourceFunction["FileFormatQ"][file,], file can be a File[] object or a string representing the file path.

Examples

Basic Examples (2) 

Test if a file is in the specified format:

In[1]:=
ResourceFunction["FileFormatQ"]["ExampleData/spikey.tiff", "TIFF"]
Out[1]=
In[2]:=
ResourceFunction["FileFormatQ"]["ExampleData/spikey.tiff", "PNG"]
Out[2]=

Specify a file using the File object:

In[3]:=
ResourceFunction["FileFormatQ"][File["ExampleData/f.c"], "C"]
Out[3]=

Version History

  • 1.0.0 – 24 February 2020

License Information