I have the following procedure where if the import file exists then the import procedure runs and the file is moved to an archive folder and then the file is deleted since another import would mess up the data. Then a email is generated informing that it has run. There is just one import per day. We have found out that sometimes another file is sent in error. What I am trying to do is check the archive folder for testfile.csv and if the file date is equal to Now() then do not run the procedure since that means that it is today's file import and it has already run and also to send a email alerting that another file is trying to import.
Any help is appreciated.
<cffile action="read" file="C:\Inetpub\wwwroot\testfile.csv" variable="csvfile">
<cfloop index="record" list="#csvfile#" delimiters="#chr(10)##chr(13)#">
<cffile action="copy" source="C:\Inetpub\wwwroot\testfile.csv" destination="C:\Inetpub\wwwroot\dataarchive\testfile.csv">
<cffile action = "delete" file = "C:\Inetpub\wwwroot\testfile.csv">
subject="file complete successful"
file complete successful