Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
RemoveFile
brin
Hi,
I am using the following method to remove some files from the taskid.
for ($i=0;$i<=$count;$i++)
{
debug("Error files are $result[$i]\n");
$task->RemoveFile($result[$i],$result[$i]);
}
$task->CallBack(0);
I get the wrong files from a perl script and pass it to a cgi, which has the above code as a part.
The above code is able to remove only one file from the taskid and not all the wrong files. Is there any command to remove multiple files from the task.
Thank You,
Brinda
Find more posts tagged with
Comments
Adam Stoller
There is
no
RemoveMultipleFiles()
command for workflow -- you could file a feature request with support if you think it important - however in this case the CLT doesn't seem to support multiple paths (whereas iwaddtaskfile does, and that's why AddMultipleFiles was added [that was one of my fulfilled feature requests]).
It might help if you provided us with information about:
where/how you define
$count
where/how you define
@result
what the output in your debug log looks like for a given run
whether or not any of your branch, workarea, directory paths and/or filenames contain
white-space
and/or other potentially awkward non-alphanumeric characters
Since it's working on one file - we'll assume you managed to get $task defined correctly - but without the other details -- it's kind of difficult to help you too much.
Also, it's generally useful if you provide information about the product version (including SP and/or patches) and OS version (including SP and/or patches) as that sometimes plays a role in how things work and/or in what environment someone should attempt to replicate the problem.
As a side note - assuming that
@result
contains the area-relative paths to the files you want removed, the code you showed could be written as:
$task->RemoveFile("$_", "$_") foreach(
@result)
;
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
brin
Hi,
Product Version Information :
Teamsite ----> 5.5.2 version and SP6 patch
Opendeploy ----> 5.6 version and SP1 patch
I have created a new CGI task in the WFT file before invoking the Metadata cgi task. This new cgi task gets the filelist and passes it to a perl script, which handles all file validations, like checking whether the files are having spaces, special characters etc. If there is any such file. it is returned to the cgi script. Then here I am trying to remove these error files from the task and pass the new filelist to the next cgi task in the wft file.
I tried out your method, $task->RemoveFile("$_", "$_") foreach(
@result)
,
But still only one file is getting deleted. What do i do......................?
Brinda
Adam Stoller
At this point - the only way we can help is to see the entire cgitask script - which means you're asking us to help you debug your code.
You might try adding your own debugging first and walk through the code step by step to make sure you understand what's happening - and thus you might be able to fix the problem yourself (which, presumably you're getting paid for while we aren't -- and it helps to build up confidence in the future) - however, failing that, you can always post your code (preferably as an attachment) and someone out here (likely, but not limited to, me) will spend some time looking through the code and trying to figure out what you're doing wrong.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com