Skip to main content
Question

File Properties, change created and modified by date

  • March 27, 2017
  • 3 replies
  • 119 views

hlouie
Contributor
Forum|alt.badge.img+16

I have a directory of PDF files scanned in 1996, I have feature dataset linked by PDF filename the with another attribute field with correct document creation date.

How can change the PDF filename properties of creation data?

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.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • March 27, 2017

FME does not have a PDF reader. So the contents can not be changed.

But if you need to copy (or move) all files to a different file name you can use:

Read the filenames using the "Directory and File path" reader.

The "File copy" writer to copy or move the files to a different location and/or name.


hlouie
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • March 27, 2017

FME does not have a PDF reader. So the contents can not be changed.

But if you need to copy (or move) all files to a different file name you can use:

Read the filenames using the "Directory and File path" reader.

The "File copy" writer to copy or move the files to a different location and/or name.

Using the File Copy, creates a new file and changes the date/time to current. It's not just PDF but any file (text, dwg, tiff) changing the created/modified date.

 


hlouie
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • March 27, 2017

Workbench

0684Q00000ArLilQAF.png

DateFormatter = 2018-01-01 to destination Epoch date %s

0684Q00000ArLbbQAF.png

Python Caller = os.utime( filename , (convert Epoch date string to int, convert Epoch date string to int)

import fme
import fmeobjects
import os


def FeatureProcessor(feature):
    os.utime(feature.getAttribute('file'), (int(feature.getAttribute('date')),int(feature.getAttribute('date'))))