Skip to main content
Question

File Properties, change created and modified by date


hlouie
Contributor
Forum|alt.badge.img+15

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?

3 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • 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+15
  • Author
  • Contributor
  • March 27, 2017
erik_jan wrote:

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+15
  • 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'))))

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