changing the group that files are created with
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 clientgrp 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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: changing the group that files are created with
On 9/18/06, Ken Foskey [EMAIL PROTECTED] 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 clientgrp 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 I'm not sure I understand. It appears you don't want to ( or can't) change the default group of your id so they are created with this group? You don't want to use chown -R or chgrp -R on directories after the fact? What about in the program before it finishes? How exactly do you identify this is a file that should have this special group? When the file is initiallly created I'm guessing you shouild set correct ownership then. If you are trying to do it after the fact then you will need to find something unique about these files to search on then issue the correct ownsership. I think I'm missing a piece of this question. And why does your command in Linux not work in AIX? Are you running current AIX?
RE: Modules to extract calendar info from Exchange
Hi, I've looked at cpan, nothings coming up. What I need to do is just extract calendar information from MS Exchange. Sending SMS I've already completed that. Just hoping maybe there's some help out there. William -Original Message- From: D. Bolliger [mailto:[EMAIL PROTECTED] Sent: 15 September 2006 10:24 PM To: beginners@perl.org Subject: Re: Modules to extract calendar info from Exchange William Paulsen (W) am Freitag, 15. September 2006 13:36: Hi, Hi Is there a perl module(s) that can extract calendar infrom from an MS Exchange server. I need to extract appmnts, meetings, etc such that I can SMS these message to a person(s) cellphone. Which modules are available, and how easy is it? No idea (and no other answers), but you could search on http://search.cpan.org with one of the keywords you're interested in. Maybe somethings shows up... Hope this helps Dani -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response ~~ This e-mail and its contents are subject to the Telkom SA Limited e-mail legal notice available at http://www.telkom.co.za/TelkomEMailLegalNotice.PDF ~~ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: changing the group that files are created with
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 clientgrp 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
File::find with no_chdir
Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; [EMAIL PROTECTED] tmp]# perl script.pl /tmp /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/test_directory/directory1 /tmp/test_directory/directory1/directory2 /tmp/test_directory/directory1/directory2/directory3 /tmp/lost+found /tmp/.font-unix But i want a behaviour like this command; [EMAIL PROTECTED] tmp]# find /tmp -type d -maxdepth 1 /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/lost+found /tmp/.font-unix Any help? Thanks Emilio C. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: File::find with no_chdir
On 9/18/06, Emilio Casbas [EMAIL PROTECTED] wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; [EMAIL PROTECTED] tmp]# perl script.pl /tmp /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/test_directory/directory1 /tmp/test_directory/directory1/directory2 /tmp/test_directory/directory1/directory2/directory3 /tmp/lost+found /tmp/.font-unix But i want a behaviour like this command; [EMAIL PROTECTED] tmp]# find /tmp -type d -maxdepth 1 /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/lost+found /tmp/.font-unix Any help? Thanks Emilio C. I believe you want to use the Prune option. This covers it with an earlier example: http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/7ffb588d4a3e67d/21c98bb6a9984979?lnk=stq=%24File%3A%3AFind%3A%3Aprunernum=1#21c98bb6a9984979
Re: File::find with no_chdir
Emilio Casbas am Montag, 18. September 2006 17:11: Hi, Hi Emilio I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; [EMAIL PROTECTED] tmp]# perl script.pl /tmp /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/test_directory/directory1 /tmp/test_directory/directory1/directory2 /tmp/test_directory/directory1/directory2/directory3 /tmp/lost+found /tmp/.font-unix But i want a behaviour like this command; [EMAIL PROTECTED] tmp]# find /tmp -type d -maxdepth 1 /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/lost+found /tmp/.font-unix Any help? #!/usr/bin/perl use strict; use warnings; print map $_\n, grep -d, ($_, $_/*) for @ARGV; __END__ Although I'm not sure if this is the recommended way - so please wait for other answers :-) Dani -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
transition to Perl developer
To the Gurus, I am in the process of making a transition over to a Perl Developer. From a knowledge standpoint, is there anything I should know or need to know. For example I do not know OO that much. What about any specific modules that are useful? Any other advice? thank you derek __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: transition to Perl developer
On Mon, 2006-09-18 at 12:38 -0700, Derek B. Smith wrote: To the Gurus, I am in the process of making a transition over to a Perl Developer. From a knowledge standpoint, is there anything I should know or need to know. For example I do not know OO that much. What about any specific modules that are useful? Any other advice? If you're interested in object oriented perl, read 'perldoc perltoot'. Interesting modules depend on what problem you're trying to tackle. -- Joshua Colson [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: File::find with no_chdir
Emilio Casbas wrote: Hi, Hello, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; [EMAIL PROTECTED] tmp]# perl script.pl /tmp /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/test_directory/directory1 /tmp/test_directory/directory1/directory2 /tmp/test_directory/directory1/directory2/directory3 /tmp/lost+found /tmp/.font-unix But i want a behaviour like this command; [EMAIL PROTECTED] tmp]# find /tmp -type d -maxdepth 1 /tmp /tmp/.ICE-unix /tmp/test_directory /tmp/lost+found /tmp/.font-unix my $dir = '/tmp'; opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: File::find with no_chdir
On 18 Sep 2006 at 15:05, John W. Krahn wrote: Emilio Casbas wrote: I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; my $dir = '/tmp'; opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; John That's looks nice John...but what is actually happening here. Some sort of negation of \A (is that a character class?) and a directory and/or something with a newline??? Could you help us mortals understand. Thanx. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: File::find with no_chdir
Beginner wrote on Mon, Sep 18, 2006 at 03:24:08PM PDT: On 18 Sep 2006 at 15:05, John W. Krahn wrote: opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; John That's looks nice John...but what is actually happening here. Some sort of negation of \A (is that a character class?) and a directory and/or something with a newline??? perldoc perlretut The map section is making sure the return value from readdir isn't the special '.' or '..' directories (the regex portion), and making sure the return value from readdir is an actual directory and not a file. For every return value from readdir, $dir/$_\n is printed if it is a directory, otherwise nothing. - David -- Difficilis facilis, iucundus acerbus--es idem: Nec tecum possum vivere nec sine te -- Martial (popularized by u2) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: finding matches in multiple arrays
On Mon, 18 Sep 2006, Jeff Pang wrote: Yes, the FAQ answer is more efficient. Using Big O notation[1], the FAQ's solution is O(n) and your's is O(n**2) where is the FAQ?sorry I never knew it. You mean perldoc perlfaq? it has perlfaq1, perlfaq2...perlfaq9. If it is not what you asked, then I am dump :) -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response Vincent Li http://mcli.homelinux.org System AdminThe Biomdedical Research Centre University of British Columbia Tel:604-822-7830 Email: mcli [EMAIL PROTECTED] brc. ubc. ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
XLS-files with Unicode?
Hi, Perl-world, Once time I tried to make XLS-file (in clean Linux machine, without ODBC, OLE...). Homework was fine, but I was need in Russian text (cp1251) in fields. How make I a russian text in xls-fields? Modules, functions, unicode, example...? Thanks for your Creativity -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: File::find with no_chdir
Beginner wrote: On 18 Sep 2006 at 15:05, John W. Krahn wrote: my $dir = '/tmp'; opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; That's looks nice John...but what is actually happening here. Some sort of negation of \A (is that a character class?) and a directory and/or something with a newline??? perldoc perlre [snip] Perl defines the following zero-width assertions: \b Match a word boundary \B Match a non-(word boundary) \A Match only at beginning of string \Z Match only at end of string, or before newline at the end \z Match only at end of string \G Match only at pos() (e.g. at the end-of-match position of prior m//g) readdir $dh returns a list of entries from the $dir directory. Inside map() each entry is aliased to the $_ variable. The contents of $_ are matched against the pattern /\A\.\.?\z/ which will only match if $_ contains '.' or '..' and if it does NOT match then $dir/$_ is tested to see if it is a directory and if it is then the string $dir/$_\n is returned. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response