fileinfo with variable as filepath

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
4 posts Page 1 of 1

ajdazeve

Posts: 5
Joined: Wed Jan 04, 2017 1:05 pm

Post by ajdazeve » Wed Jan 04, 2017 1:56 pm
Hi there,
I am trying to build an if condition to find out if a file exists. However the filepath is contained in a variable . In this case variable name = item
Now I am trying the following
${FileInfo('"${item}"'):exists}
I tried with simple ,double quote… it tries to find item not the actual content of the variable.
To put a bigger picture on the project… here is what it will does.
Project gets file list from a folder…. Then goes into a loop
sends each file to an icap server for scanning..
if there’s a virus it deletes the whole folder ….( we don’t want any of the content if a virus is found).
Then it goes back in the loop grabs the next file.
Now this work very well if a virus is the last file in the list. Elsewhere since I deleted the folder the next icap request is with and empty file … that return an error code that is the same as if the antivirus dosent responds. In order to avoid unnecessary calls and false positive I want to put a if condition
Just before calling the antivirus module… verify if the file exists… if so …. Go if not next file.
Any ideas?

Support_Rick

Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Jan 04, 2017 4:35 pm
The parameter for the FileInfo command has to be a STRING. Thus,

${ FileInfo(String( item ) ):exists }

Should get you what you're looking for!
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

ajdazeve

Posts: 5
Joined: Wed Jan 04, 2017 1:05 pm

Post by ajdazeve » Wed Jan 18, 2017 10:02 am
this worked thank you

ajdazeve

Posts: 5
Joined: Wed Jan 04, 2017 1:05 pm

Post by ajdazeve » Fri Feb 17, 2017 11:50 am
hi its me again this syntax worked well

${ FileInfo(String( item) ):exists }
however i woudl like to validate a folder the full path is in 2 different variables.
now since i have to add the / mft is trying to divide both variables
i tried like this dosent work
${ FileInfo(String('${path}/${cleanName}') ):exists }

how should i do this ?
4 posts Page 1 of 1