On 09/18/2006 02:06 AM, Ken Foskey wrote:
I have a lot of files created by a (much too) complex script and the
user I am running with has a default group of 'staff' but I want all
files created to have <client>grp which we create to ensure that only
authorised people have access to a particular clients data.  I have a
command in Linux that does this but I am running on AIX  (I want it
portable so a pure perl method is better...)

MY solutions are chgrp on the file after creation.  Great initially but
then someone will forget for a new file and besides it adds a lot more
code and the complexity goes up.  I ended up adding the group to the
directory with g+s to force the group but there may be a time were we
use common directories and the file should be protect there as well.

I cannot google an answer because there are too many answers and I
cannot figure out how to fine tune my query.


I want to change the group files are created with and I cannot google an
answer because I get too many answers.

Thanks
Ken Foskey



In a shell, I might use the newgrp command before running programs that create files; however, in a script, this would only work for Expect invoked scripts and sub-shells. You might be able to create a stub script that changes into the new group (using 'sg'--switch group) then invokes your main script like so:

    system("sg client-grp -c 'perl main.1.pl'");

You asked how to do this in a platform-independent way. I have no earthly idea how to do that.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


  • chan... Ken Foskey
    • ... Jack Faley ( Who's going to take me serious without a laser pointer?)
    • ... Mumia W.

Reply via email to