Skip to main content
Solved

Transformer exposing file properties

  • December 24, 2015
  • 1 reply
  • 119 views

hermanlouie
Participant
Forum|alt.badge.img

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.

Best answer by takashi

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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • December 24, 2015

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