[SOLVED] Accessing file meta data such as "date modified"
tennenrishin
New Altair Community Member
Is there any way in RM to access, for example, the date at which some given file (in the file system) was modified?
Tagged:
0
Answers
-
Not out of the box, however you could probably use the Execute Program operator to fire up an external tool which delivers the desired data.
Best regards,
Marius0 -
Hi,
actually there is a way
However it involves the Script operator and you do need Java 7 for it.
A quick example on how it can be done:
Regards,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="execute_script" compatibility="5.3.008" expanded="true" height="60" name="Execute Script" width="90" x="179" y="30">
<parameter key="script" value="import java.nio.file.Files; import java.nio.file.Paths; import javax.swing.JOptionPane; JOptionPane.showMessageDialog(null, "File last modified: " + Files.getLastModifiedTime(Paths.get("C:", "Users", "username", "Desktop", "Test.txt")));"/>
</operator>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
Marco0 -
Thank you!0