Skip to content

Checking File Date

Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
  • Malbanese Offline
  • Posts: 1
  • Joined: Mon Nov 19, 2018 4:00 pm

Checking File Date

Post by Malbanese »

Hello ~ I am trying to have a conditional statement that checks the data of a file and if it does not match the current system date to send me an email, otherwise the file gets SFTP to a vendor. I am having trouble with the syntax that checks the file date.

This is my "IF" condition:

${FileInfo('C:\Program Files\HelpSystems\GoAnywhere\userdata\webdocs\Temp\FULLUPBAL.CSV')}:lastModifiedDate < system.currentDate

Which throws this error:

[8046 - If: ${FileInfo('C:\Program Files\HelpSystems\Go...] Invalid condition syntax in attribute 'condition' of element 'if'. Unrecognizable character '}' found at position '87'.

Any help would be appreciated

Re: Checking File Date

Post by Support_Jake »

Your syntax is off just a little bit, and also I think you may be missing a timestamp task in your project. I have attached my XML for your example but most importantly below is the string I ended up using (Please replace with your full file name as mine is just for testing).

IF Condition:
${FileInfo('C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv'):lastModifiedDate < TimestampNow}

Code: Select all

<project name="Check if File edited today" mainModule="Main" version="2.0" logLevel="verbose">

	<module name="Main">

		<print version="1.0">
			<![CDATA[${FileInfo('C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv'):lastModifiedDate}]]>
		</print>


		<timestamp version="1.0">
			<format outputVariable="TimestampNow" />
		</timestamp>

		<if condition="${FileInfo(&apos;C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv&apos;):lastModifiedDate &lt;  TimestampNow}" disabled="false">

			<print version="1.0">
				<![CDATA[~~This was edited BEFORE the timestamp was taken~~]]>
			</print>


			<exitProject version="1.0" />

		</if>

		<print version="1.0">
			<![CDATA[***This was edited AFTER the timestamp was taken***]]>
		</print>

	</module>

</project>
Jacob Przybysz
Associate Support Manager
+1 402.944.4242 Image fortra.com
Image
Post Reply