When I use the following code, I get an error on the bolded line. I also noticed that the file is not downloaded to the __Download folder or moved to the C:\temp. If I remove the bolded line, the download occurs and is moved to the correct folder. It seems that it is checking for the file even before the is downloaded. If I put the file in the c:\temp folder before executing the fixlet, the actions will complete successfully. Any ideas?
I took out all the code between the if else elseif and just put comments and still had the issue. I also removed that if statement and everything following to see what would happen and the file would download and move to the c:\temp directory as expected.
BTW, I forgot to mention a couple things:
the file will change on a daily basis so I cannot use prefetch since it requires the sha1/file size
download http:
//<server>:52311/Uploads/Software_Servers/server_location_env/server_location_env.csv
continue
if
{exists file
"server_location_env.csv" of folder
"__Download"
}
//Delete existing file and download the latest version. delete
"C:\temp\server_location_env.csv" move
"__Download\server_location_env.csv"
"C:\temp\server_location_env.csv"
continue
if
{exists file
"server_location_env.csv" of folder
"c:\temp"
}
if
{exists file
"server_location_env.csv" of folder
"c:\temp"
}
if
{exists parenthesized part 1 of matches (regex
"^(.*),.*,.*,.*,.*,.*,.*,.*,.*,.*$") of (lines whose (it as lowercase contains computer name as lowercase) of file
"c:\temp\server_location_env.csv")
} ...
else ... endif
else ... endif
That makes sense. The “is the file there?” test was not the first bit of Relevance getting substituted… jn the first version you were allowing the Relevance engine to start doing it’s work before it checked that the file existed.
I must be missing something. I had the “continue if {exists file …” before the “if exists parenthesized …”, the only difference was adding another check to see if the file exists. From what I can tell from the logs, it never evaluated the “continue if” statement or the downloads.
I am wondering if this is going to actually fix it (well workaround) or I am just getting lucky and the timing is just right that the download happens before the rest of the actions.
It seems that every other fixlet I have written has never had this issue as I have never had to do something quite like this. My impression was that it does line 1, then line 2, etc, not line 5, then line 1, etc.