Quote:
>> if (($stats[0] != $lstats[0]) or ($stats[1] != $lstats[1])) {
>It seems to me that
> if (! -l $file) {
>would be much simpler here.
doh! i actually had the camel book open to the page on file test
operators while typing the above, but still somehow missed the -l
operator.
i've tried working this into my script, but it doesn't seem to be doing
what i want. here's the important chunk:
sub uid_find_action {
if (! -l $File::Find::name) {
($uid == $from_uid) &&
(chown $to_uid, $uid_tmp_array[5], $File::Find::name);
} else {
system ("chown","-h","$to_uid","$File::Find::name");
};
Quote:
};
this is the find_action subroutine for a find (from the File::find
module) that iterates across a hash of uids to map from/to. the script
worked fine before, when the action was just the first portion of the if
loop, and for those files that aren't symlinks (and thus still use that
portion), things still work. for the symlinks, however, the $to_uid var
that is being used for all of the system calls is the last one of the
hash, as opposed to the appropriate one for that particular iteration. is
there any reason that $to_uid would change depending on which part of the
if logic above were matched?
(if the problem doesn't look like it is in this particular chunk, and
you'd like to do me a huge favor, the entire script is at
<http://astaroth.nit.gwu.edu/~sweth/geek/mvid.pl>. this was the only part
that was changed, though (i think), between working and not working.)
-- sweth.
--
Sweth Chandramouli
IS Coordinator, The George Washington University
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>