Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Set Extended Attributes at folder level
lizn
I'm using teamsite 6.1 s.p 1
We have a script that allows us to set EA on a file after we copy it from one area to another area. I was wondering how to set EA from the folder level and set EA for anything inside the folder?
Find more posts tagged with
Comments
Johnny
You can't set EA's on folders... folders don't mean much in TeamSite.
Your script could check to see whether a file or folder has been selected and if it's a folder it can traverse it looking for files.
If you are doing this in PERL, File::Find or TeamSite:
irwalk will help you out.
John Cuiuli
iwovGraduate
Also, search on the forums. This has been discussed many times. If I remember correctly somebody even posted code to do this.
nipper
actually search the tech library, there are a couple of scripts that can help
jbonifaci
I prefer using opendir, readdir and closedir for processing directories. Something else to keep in mind.
Johnny
Will you guys go away... I'm handling this.
John Cuiuli
iwovGraduate
Nah, we all want a piece of it
Johnny
John Cuiuli
lizn
Here's the ipl file that i've found and try running but i'm getting some errors. I keep getting "The system cannot find the path specified". I've narrowed it down to the line $result=`$cmd`; but have no idea what I need to do to get it to work.
#!e:\iwpub\iw-home\INTERW~1\teamsite\iw-perl\bin\iwperl
use File::Find;
use TeamSite:
CRnode;
use TeamSite:
CRparser;
my
@list
= ();
my
@matches
= ();
$path = 'Y:\default\main\CountryPassportProd\WORKAREA\common_WA\content\aboutUs\benefits\401kPlan';
$EA = 'TeamSite/Templating/PrimaryPT';
$value = shift;
find(\&wanted, $path);
foreach $file (
@list)
{
if (($file =~ '.dtd') || (-B $file) || ($file =~ '.js') || ($file =~ 'cfg') || ($file =~ 'tpl')) {next;}
$cmd = 'E:\\iw-home\\bin\\iwextattr -g '.$EA.' "'.$file.'" 2> /dev/null';
$result=`$cmd`;
if ($value) {
if ($result =~ $value) {print "$file has $EA set to $result\n"; }
} else {
if ($result) {print "$file has $EA set to $result\n";}
}
}
sub wanted {-f && push(
@list
, $File::Find::name);}
nipper
You are running DOS, so the command should be iwextattr.exe
iwovGraduate
I don't think the .exe matters. I normally use all CLTs without .exe extension.
iwovGraduate
I think the "The system cannot find the path specified" message is because of the redirect to /dev/null - which does not make sense to Windows.
$cmd = 'E:\\iw-home\\bin\\iwextattr -g '.$EA.' "'.$file.'"
2> /dev/null'
;
Remove that redirect to /dev/null and try again.
Adam Stoller
#!e:\iwpub\iw-home\INTERW~1\teamsite\iw-perl\bin\iwperl
...
foreach $file (
@list)
{
...
$cmd =
'
E:\\iw-home\\bin\\iwextattr
-g
'
.$EA.' "'.$file.'" 2> /dev/null';
...
}
All sorts of mistakes here
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com