Skip to main content

I know there is a File/Directory Reader but I don't want to read the whole directory of files.

I'm trying to find a transformer that I could use in the work flow that exposes file properties ie date created, date modified. Reading a polygon with an attribute "ABC123.PDF" and test with a FME Store FileExistenceChecker filter. If exists get the modified date of "ABC123.PDF" and push in an attribute.

This should be possible with a PythonCaller or TCL but is there a Transformer I missed before I try to write one.

You can use the FeatureReader with the PATH reader to retrieve properties of an existing file.

Assuming that you have a feature which contains two attributes: "_folder_path" (folder path containing the target file) and "_filename" (the target file name).

  • Format: Directory and File Pathnames (PATH)
  • Dataset: _folder_path (attribute value)
  • Attributes to Expose: path_created_date, path_modified_date (and other required properties)

Parameters setting of the PATH reader ([Parameters] button in the FeatureReader parameters dialog)

  • Path Filter: _filename (attribute value)
  • Retrieve file properties: YES

Reply