Skip to main content
Solved

Transformer exposing file properties

  • December 24, 2015
  • 1 reply
  • 108 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
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Evangelist
  • 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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings