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)
How to detect deleted files in a task's file list?
B80116
In my workflow, I have an external task which sends an eMail which lists all the files attached to that task.
I use $task->GetFiles(); to get the file list, then I use foreach to loop through the file list and add the file names to the text of my eMail.
This works fine; however, I am now looking for a way to detect which, if any, files in the file list are deleted, so I can then indicate in my eMail that those files are marked for deletion.
Does anyone know how to do this?
Thanks.
(TS 6.1, Win2000)
Find more posts tagged with
Comments
Adam Stoller
I believe this will do the job (untested):
use TeamSite::Config;
my $iwmount = TeamSite::Config::iwgetmount();
my $area = $task->GetArea();
my
@mod
;
my
@del
;
foreach ($task->GetFiles()){
if (-e "$iwmount$area/$_"){
push(
@mod
, $_);
}
else {
push(
@del
, $_);
}
}
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Dwayne
use TeamSite::Config;
--
Current project: TS 5.5.2/6.1 W2K
WORKFLOWdude
Ghoti/Fish:
That code works (in your previous post). We've been using it in our workflow logs to flag the deleted files. Is there similar code that can be used to flag the unmodified files that were submitted?
Mark
jbonifaci
They are checking for the existence of the file, so probably not. You could probably get something working with iwfilestate or iwcmp though.
~Jeff
nipper
something like this:
foreach ($task->GetFiles())
{
if (-e "$iwmount$area/$_"){
$mod =`$iwhome/bin/iwattrib $iwmount$area/$_ modified`;
chomp ($mod);
if ($mod == "TRUE" {
push(
@mod
, $_);
}
} else {
push(
@del
, $_);
}
}
jbonifaci
Ah, yes, or iwattrib too.
Thanks for making me look dumb Andy,
.
~Jeff
nipper
Thanks for making me look dumb Andy
No, you do a fine job of that.
Andy