file_format (x)

The file_format(x) function returns the type of file x. The file must exist.

Possible return values:

  • unknown: Unable to determine the type of the file
  • doc: Microsoft Word document
  • docx: Microsoft Word Open XML document
  • rtf: Rich Text Format (RTF) document
  • ps: PostScript file
  • pdf: PDF document
  • sxw: OpenOffice.org / StarOffice
  • odt: Open Document Format (ODF)
  • lwp: WordPro document
  • wpd: WordPerfect document
  • html: HTML document

These are values of type Text.

Example

file_format ("c:\mydir\somefile")

Result: one of the listed responses.