[17704] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5124 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 15 14:10:32 2000

Date: Fri, 15 Dec 2000 11:10:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976907415-v9-i5124@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Dec 2000     Volume: 9 Number: 5124

Today's topics:
        perl and apache process <xuvetyn@my-deja.com>
    Re: Perl programming <fty@mediapulse.com>
    Re: Quick and easy question about arrays nobull@mail.com
    Re: Regex can't be greedy with /(a|ab)/ ? (Anno Siegel)
    Re: Regex can't be greedy with /(a|ab)/ ? <uri@sysarch.com>
    Re: Regex can't be greedy with /(a|ab)/ ? <uri@sysarch.com>
    Re: Regex can't be greedy with /(a|ab)/ ? (Anno Siegel)
    Re: rounding with "printf %f" ()
        Splitting on more than one character (Ben Okopnik)
    Re: Splitting on more than one character (Tom Christiansen)
        stripping info, transposing info <seppy@chartermi.net>
    Re: This must be a FAQ (; in stings) (Tom Christiansen)
    Re: This must be a FAQ (; in stings) <mjcarman@home.com>
        Total Beginner <sandy12574@ic24.co.uk>
        Truncate A Log File <skpurcell@hotmail.com>
    Re: Truncated text from a POST operation <joe+usenet@sunstarsys.com>
        using PERL for process automation rrknight@usgs.gov
    Re: while(m//g) v.s. while(s///g) (Tom Christiansen)
    Re: Why are multiple zeroes true? <uri@sysarch.com>
    Re: Windows cant recognize the original owner nobull@mail.com
    Re: Windows cant recognize the original owner <gareth@uberdog.net>
    Re: Windows cant recognize the original owner <asmith@nospam.daanorthwest.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 15 Dec 2000 18:29:03 GMT
From: entropy <xuvetyn@my-deja.com>
Subject: perl and apache process
Message-Id: <91dnt4$agd$1@nnrp1.deja.com>

hey, i thought this would have already been done a million times, but i
can't find anything on it.
i need a script that checks to make sure that the apache process is
running and if not, start it. before i spend too much time on this my
self, i thought i'd check to see if it's already been done (no need to
reinvent the wheel, right? =)

thanks in advance....


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Fri, 15 Dec 2000 16:05:29 GMT
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: Perl programming
Message-Id: <djr_5.88639$IP1.2988249@news1.giganews.com>

"Anuj" <anujm2000@hotmail.com> wrote in message
news:t3jlkdmaeoku6a@corp.supernews.com...
> In the DOS prompt i have to write "PATH=/perl/bin" always
> before running the script and then writing the initializing command
> i.e "perl hello.pl" ( An example file hello.pl) . Is there a way that i
> dont need to always write the PATH=/perl/bin command so that i can
> directly run the scripts from the DOS prompt by typing "perl hello.pl".

edit autoexec.bat and add the line:

SET PATH=%PATH%;C:\perl\bin

--
###############################
Take care of your shoes...jay
Jay Flaherty                     fty@mediapulse.com
Mediapulse, Inc. -The pulse of your eBusiness



------------------------------

Date: 15 Dec 2000 17:30:18 +0000
From: nobull@mail.com
Subject: Re: Quick and easy question about arrays
Message-Id: <u9zohx3845.fsf@wcl-l.bham.ac.uk>

msalerno@my-deja.com writes:

> Subject: Quick and easy question about arrays

"Quick and easy question" conveys no useful info.

Nothing "about arrays" here.

Why change the subject of the thread to something random?

[snip 117 line irrelevant qoute]

> What if there is another value after $shell, what will happen to it ?
> 
> my($user,$pword,$uid,$gid,$comment,$home,$shell)=split(/:/,$lines[$i]);

Hmmm... lets see:
  $user gets the first piece of $lines[$i]
  $pword gets the second piece of $lines[$i]
   ...
  $shell gets the seventh piece of $lines[$i]

Have you spotted the pattern yet...

If you put another variable in there it would get... wait for
it... the 8th piece.

If there are more elements in the list on the RHS of a list assignment
thent there are places to put them on the LHS then they are discarded.

If there are fewer pieces than there are elements in the lvalue list
then remaining variabls are set to undef.

For further details of the semantics of the Perl assignement statement
see perldata.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 15 Dec 2000 17:26:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <91dk8k$c54$1@lublin.zrz.tu-berlin.de>

Linc Madison  <lincmad001@telecom-digest.zzn.com> wrote in comp.lang.perl.misc:

>Hmm. I hadn't ever considered the possibility of a sort function that
>returned different results for two invocations on the same pair of
>elements. When would such a thing ever be desirable?

You'd be amazed, people try the darndest things.  I've seen similar
to

    @shuffled = sort { rand <=> rand } @deck;

in an attempt to generate a random permutation.  No, it's still not
desirable.

On the other hand, this sort of thing can happen inadvertently if
the sort function has side effects that influence the next outcome.
BTW, a Schwartz (or similar) transform is a life insurance against
a this type of sort segfault because the sort function is only called
once per list element.

Anno


------------------------------

Date: Fri, 15 Dec 2000 17:40:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <x7wvd1h9aw.fsf@home.sysarch.com>

>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:

  AS> Linc Madison  <lincmad001@telecom-digest.zzn.com> wrote in comp.lang.perl.misc:
  >> Hmm. I hadn't ever considered the possibility of a sort function that
  >> returned different results for two invocations on the same pair of
  >> elements. When would such a thing ever be desirable?

  AS> On the other hand, this sort of thing can happen inadvertently if
  AS> the sort function has side effects that influence the next outcome.
  AS> BTW, a Schwartz (or similar) transform is a life insurance against
  AS> a this type of sort segfault because the sort function is only called
  AS> once per list element.

huh? assuming an O( N * log N ) sort (like quicksort on average) then
the sort function is called N * log N times. and it is called on pairs
of elements so you can't tell (without checking inside the sort
function) how often it is called per element.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Fri, 15 Dec 2000 17:45:50 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <x7u285h92r.fsf@home.sysarch.com>

>>>>> "LM" == Linc Madison <lincmad001@telecom-digest.zzn.com> writes:

  LM> I was holding my sort function to a higher-than-necessary standard,
  LM> specifically that it should produce the same output ordering,
  LM> irrespective of the input ordering. That's what I think of in terms of
  LM> a "well-defined sort."

that is known as a stable sort where records which sort the same then
stay in the same relative order they started with. the new perl qsort in
5.6 is a stable sort while 5.005 and earlier are not stable. but that is
not a defined property of perl's sort so don't rely upon it. also the
new sort won't core dump if the sort function is not consistant which is
why it was chosen. it will always return a sorted list.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: 15 Dec 2000 18:49:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <91dp3n$cas$1@lublin.zrz.tu-berlin.de>

Uri Guttman  <uri@sysarch.com> wrote in comp.lang.perl.misc:
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
>  AS> Linc Madison  <lincmad001@telecom-digest.zzn.com> wrote in comp.lang.perl.misc:
>  >> Hmm. I hadn't ever considered the possibility of a sort function that
>  >> returned different results for two invocations on the same pair of
>  >> elements. When would such a thing ever be desirable?
>
>  AS> On the other hand, this sort of thing can happen inadvertently if
>  AS> the sort function has side effects that influence the next outcome.
>  AS> BTW, a Schwartz (or similar) transform is a life insurance against
>  AS> a this type of sort segfault because the sort function is only called
>  AS> once per list element.
>
>huh? assuming an O( N * log N ) sort (like quicksort on average) then
>the sort function is called N * log N times. and it is called on pairs
>of elements so you can't tell (without checking inside the sort
>function) how often it is called per element.

Well, this type of transform extracts a sort key once per element and
then applies a (usually) trivial comparison routine.  This makes it
relatively hard for comparisons to contradict one another, even if
key extraction suffers from side-effects (and might extract a different
key each time).

Come to think of it, if this happens the sort result is probably not
what was intended anyway.  But your program won't crash. :)

Anno


------------------------------

Date: 15 Dec 2000 17:44:26 GMT
From: rfield@best.com ()
Subject: Re: rounding with "printf %f"
Message-Id: <91dl9q$1juu$1@nntp1.ba.best.com>

I would assume that in this, as in much else, Perl uses the runtime library
of whatever C compiler was used to build the executable and you are at
the mercy of the libraries definition of printf.

An old Perl I have that was build with the djgpp compiler gives 6.
Microsoft Visual C++ produces 7 for printf("%.0f", 6.5). Try perl -v to find
out what compiler your executable was built with.

I would suggest explicitly rounding the number you want to appear, as is
suggested at the bottom of this post. Proper rounding is a finicky process.

>>
>>The "printf %.0f" command doesn't give the result that I
>>expect:
>>
>>$ perl -e 'printf "%.0f\n",6.5'
>>6
>>$ perl -e 'printf "%.0f\n",6.501'
>>7
>>$
>>
>>I expect 6.5 also to be rounded to 7. Why doesn't perl do this?
>>Is there another way for rounding, which gives me the result
>>that I expect?
>>
>>Felix

>Strange, both statements print '7' for me (I use v5.6.0 built for
>MSWin32-x86-multi-thread). Maybe you can solve it by using:
>$rounded = int($value + 0.5)

>greetings,
>Sander



------------------------------

Date: 15 Dec 2000 17:54:55 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Splitting on more than one character
Message-Id: <slrn93kmu1.ank.fuzzybear@Odin.Thor>

I'm having a problem with splitting a string that has the following form:

"This is part1" (Here is part2) [And this is part3]

The first part will always be present. The second and the third parts may
or may not be (column-delimited data). I need to split this into variables
$a, $b, and $c.

Here's what I've tried, with lots of variations:

($a, $b, $c) = split /("\(\)\[\])/;
($a, $b, $c) = split /"|\(|\)|\[|\]/;

etc. The typical result is

$a=''
$b='"'
$c='This'

I've RTFMd. <sigh> I find that particular perldoc as clear as mud; *no* 
help. Advice, including solutions that don't use split, would be greatly
appreciated.


Ben Okopnik
-=-=-=-=-=-


------------------------------

Date: 15 Dec 2000 11:06:48 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Splitting on more than one character
Message-Id: <3a3a5db8$1@cs.colorado.edu>

In article <slrn93kmu1.ank.fuzzybear@Odin.Thor>,
Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>I'm having a problem with splitting a string that has the following form:
>
>"This is part1" (Here is part2) [And this is part3]
>
>The first part will always be present. The second and the third parts may
>or may not be (column-delimited data). I need to split this into variables
>$a, $b, and $c.
>
>Here's what I've tried, with lots of variations:
>
>($a, $b, $c) = split /("\(\)\[\])/;
>($a, $b, $c) = split /"|\(|\)|\[|\]/;
>
>etc. The typical result is
>
>$a=''
>$b='"'
>$c='This'
>
>I've RTFMd. <sigh> I find that particular perldoc as clear as mud; *no* 
>help. Advice, including solutions that don't use split, would be greatly
>appreciated.

    $_ = q("This is part1" (Here is part2) [And this is part3]);
    ($a) = /  " ( [^"]* )  " /x;
    ($b) = / \( ( [^(]* ) \) /x;
    ($c) = / \[ ( [^[]* ) \] /x;

    print "a=$a\n";
    print "b=$b\n";
    print "c=$c\n";

To produce:

    a=This is part1
    b=Here is part2
    c=And this is part3

--tom


------------------------------

Date: Fri, 15 Dec 2000 14:00:15 -0500
From: "Brian E. Seppanen" <seppy@chartermi.net>
Subject: stripping info, transposing info
Message-Id: <3A3A6A3F.36DDF6AE@chartermi.net>

I'm trying to write a script that will check users quota's.  Right now,
I'm thinking that I can do this by taking du --max-depth=1,  and putting
that into a hash.
One issue is that du --max-depth=1 returns the following data

8 ./blah1
8 ./blah2
20 .

If this were to be useful it would seem that I have a couple of things I
need to do
1) eliminate the final line (it serves no useful purpose).
2) eliminate the ./
3) transpose username and size, so that I can use username as a key to
the has.

I'd appreciate any suggestions.

Brian Seppanen
Charter Communications				
Regional Data Center				906-228-4226 ext 23
Marquette, MI					seppy@chartermi.net


------------------------------

Date: 15 Dec 2000 09:14:07 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: This must be a FAQ (; in stings)
Message-Id: <3a3a434f@cs.colorado.edu>

In article <91dbf5$f46$1@panix6.panix.com>, Stan Brown <stanb@panix.com> wrote:
>	This must be a FAQ, but searching in this newsgroup on the ket FAQ did
>	not reveal the answer.

That's *NOT* how you search the FAQ.  This newsgroup is not the FAQ.
The perlfaq manpage is the FAQ.   Time to trot out perlrtfm again, 
I see.

--tom


------------------------------

Date: Fri, 15 Dec 2000 10:51:03 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: This must be a FAQ (; in stings)
Message-Id: <3A3A4BF7.B4159DBB@home.com>

Stan Brown wrote:
> 
> This must be a FAQ, but searching in this newsgroup on the ket 
> FAQ did not reveal the answer.
> 
> How do I get a ; in a string?

my $string = 'some text with a ; in it';
 
> I'm trying to do someting like this:
> 
> $var2 = $var1, '.*;*';
               ^
You want a '.' here, not a ','

> $ftp->delete($var2):
> 
> That is, take an existing string variable, and add ".*;*" to 
> it, the use this variable.

That's a different question -- you want to append to a string. There are
a couple ways:

Using the concatenation operator:

$var2 = $var1 . '.*;*';

Using interpolation:

$var2 = "${var1}.*;*";

The {} around var1 are to seperate it from the rest of the string. You
don't strictly need them here but they don't hurt, and if the string
you're adding started with an alphanumeric char or an underscore then
you would need them. So it's a good habit.

-mjc


------------------------------

Date: Fri, 15 Dec 2000 18:59:30 -0000
From: "Sandra Pearce" <sandy12574@ic24.co.uk>
Subject: Total Beginner
Message-Id: <91dpkd$d61$1@newsg2.svr.pol.co.uk>

Hi,

Any good sites for a total beginner to perl....
I want to create some CGI scripts.





------------------------------

Date: Fri, 15 Dec 2000 11:51:28 -0600
From: "spurcell" <skpurcell@hotmail.com>
Subject: Truncate A Log File
Message-Id: <3a3a5a9d$0$14653@wodc7nh6.news.uu.net>

Hello,
I have a log file (I am on a NT box), and I just had noticed that it is
getting rather large. The scripts is one that runs 7 days a week 24 hours a
day. Anyway, I have been told I only need to keep about 500 lines of
logfiles so I was wondering what may be the best way to truncate a log file.
I can open the logfile and read it, but I don't know whether to use a perl
Truncate function or substr?

Could someone possibly give me guidance.

thanks
scott




------------------------------

Date: 15 Dec 2000 12:51:48 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Truncated text from a POST operation
Message-Id: <m3snnptvwr.fsf@mumonkan.sunstarsys.com>

Steve Jelfs <steve.jelfs@oracle.com> writes:

> I have a web form which passes text from a textarea, via a POST
> operation, to a perl script which then processes the data.
> 
> The trouble is - this text keeps getting truncated although I though
> that a POST wouldn't truncate (as opposed to GET).
> 
> Here's the bit I'm using to read the variables - am I missing something?
> 
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

% perldoc -f read
=item read FILEHANDLE,SCALAR,LENGTH,OFFSET

=item read FILEHANDLE,SCALAR,LENGTH

Attempts to read LENGTH bytes of data into variable SCALAR from the
specified FILEHANDLE.  Returns the number of bytes actually read,
C<0> at end of file, or undef if there was an error.  

[...]

In particular, note the first word.  Use CGI.pm to avoid
reinventing the wheel.

HTH.
-- 
Joe Schaefer



------------------------------

Date: 15 Dec 2000 18:08:09 GMT
From: rrknight@usgs.gov
Subject: using PERL for process automation
Message-Id: <91dmm9$7rf$2@qvarsx.er.usgs.gov>

I am slowly learning PERL, slowly.  I am trying to use the script below to 
execute a program from the command prompt.  Once the program has been 
executed it waits for  input from the user, which I am trying to get the 
PERL script to do for me.  The script gets the pprogram going to the point 
that it is waiting for the input (location of file in this case), but then 
does nothing.  Can someone give me some guidance on how to get PERL to do 
this, to provide the input that the command porompt is waiting for.  It 
just doesn't seem to want to do anything after the program has been 
executed.

chomp ($name = <>);  # name is the path name to the input file
print $name;
use Win32::Process;
Win32::Process::Create($ProcessObj,
        "F:\\data\\hspf11.0\\bin\\hspf.bat",
        "hspf $name",
        1,
        CREATE_NEW_CONSOLE,
        ".") || die "dead";


Any help is appreciated.


Rodney


------------------------------

Date: 15 Dec 2000 09:17:31 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: while(m//g) v.s. while(s///g)
Message-Id: <3a3a441b$1@cs.colorado.edu>

In article <vufk3t01bmr086r6ja7vp6ejkjcfctks9t@4ax.com>,
Bart Lateur  <bart.lateur@skynet.be> wrote:
>You can build the code block into the substitution side, if you provide
>the /e modifier.
>
>	$_ = " 1  2  3  4  5 ";
>	s/\d/print "replacing $&\n"; "0"/ge;
>	print;

You don't need the /e.

    $_ = " 1  2  3  4  5 ";
    s/\d(?{print "replacing $&\n"})/0/g;

There are even cleverer things you can do, too.

--tom


------------------------------

Date: Fri, 15 Dec 2000 18:16:58 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Why are multiple zeroes true?
Message-Id: <x7puith7mu.fsf@home.sysarch.com>

>>>>> "TC" == Tom Christiansen <tchrist@perl.com> writes:

  TC> In article <x7zohygpod.fsf@home.sysarch.com>,
  TC> Uri Guttman  <uri@sysarch.com> wrote:
  >> it doea make sense if you think about perl's conversions. undef is the
  >> real false value. 

  TC> I don't think that's right.  Would you not agree that the result
  TC> of the expression C<< 1 < 0 >> is as "real" a false value as it
  TC> gets?  It returns the null string.  This is not undef, but rather
  TC> the defined null string.

maybe i should have been more clear. in trying to express why '0' is
false and '00' is true i was using context conversions. you can't
convert to undef so i showed how and why converting from undef should
still be false. so in that respect undef is the first false value and
the others are derived from it. whatever flase value perl returns
internally should not matter as long as it is false in all boolean
contexts. i would not rely on the null string being returned but only
some legal false value from any false comparison operation. 


  TC>     % perl -Mwarnings -le '$x = 1 < 0; print $x+10'
  TC>     10

  TC> Isn't that interesting?  If not, look again. :-)

that is interesting. even under 5.005_3 with -w it doesn't
squawk. assigning "" to $x gives out the warning.

and it propogates. 

perl -wle '$x = 1 < 0 ; $y = $x ;print $y+10'

so it also has the numeric flag set internally so it can be used as 0 or
"" in any context without warnings.

  TC> It's cleanest to thing of there being just two false values in Perl:
  TC> zero and the null string--thus, anything that reduces to one of
  TC> these is itself false.  I like thinking of it like this because
  TC> it's easier to remember just 2 rules than the 4, 5, or even 6 that
  TC> you often see people cite.

which is why i tried to show how all the false values derive from
undef. then you have 1 rule.

starting with undef you can derive:

undef	-> 0
undef	-> ''
0	-> '0'

you can't automatically convert anywhere else from those values. so that
is the set of false values. which one perl returns for an operation is
not relevent other than making life quieter with fewer warnings.

  TC> However, the C<"0"> case is a bit of an outlier.

  TC>     whether_'tis_false ::= (length==0) || (length==1 && string eq "0")

  TC> But yes, it's to facilitate more transparent er, um, "numerocadential
  TC> introconvertibility" :-).  You wouldn't want the internal representation
  TC> to matter.  It would be nasty if something's Boolean value were
  TC> different depending on how you got to the C<"0">.

  TC> This is not always a completely compelling argument, I realize.
  TC> Larry could doubltess offer a more convincing treatment.

yes indeed. it is a tricky thing to explain as we have both seen. i like
my derivation idea and i will see how others take to it. it does have
simplicity at it heart and it automatically stops after the 3
derivations.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: 15 Dec 2000 17:23:21 +0000
From: nobull@mail.com
Subject: Re: Windows cant recognize the original owner
Message-Id: <u93dfp4n06.fsf@wcl-l.bham.ac.uk>

Alessandro Augusto <Alessandro.Augusto@br.bosch.com> writes:

> The only way I found , being the administrator, to change the
> permissions of this directory, is taking the ownership of it.

This is a feature - the idea is that even an administrator you can't
casually look into a user's files without leaving behind a footprint.

This is overcome by a SUBINACL in the resource kit that allows you to
set arbitary owners on a file.

> Ps. I posted this message to comp.lang.perl cause, I found this
> during a test of my perl script which apply ACLs to files.

I suppose the readers of rec.food.drink.coffee should be thankfull you
weren't drinking a cup of coffee at the time.

Followup-To set.
	
-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Fri, 15 Dec 2000 18:07:52 GMT
From: Gareth Jones <gareth@uberdog.net>
Subject: Re: Windows cant recognize the original owner
Message-Id: <44nk3t8eapjisatuqjfkpjmf0gostvafck@4ax.com>

Alessandro Augusto <Alessandro.Augusto@br.bosch.com> wrote:

>Thats exacly what I want to do on NT.
>How do I do it, to get the older owner, set the administrator as the owner,
>change some permissions of this object, then set back the original owner.

you need a version of chown (change owner) for NT. You can get one at:

http://wwwthep.physik.uni-mainz.de/~frink/nt.html

>How do I do that on a object (file or folder) that the administrator permissions
>were removed?

Take ownership, set the permissions the way you want, change ownership
back.

Gareth


------------------------------

Date: Fri, 15 Dec 2000 10:06:18 -0800
From: "- AJS" <asmith@nospam.daanorthwest.com>
Subject: Re: Windows cant recognize the original owner
Message-Id: <91dmg4$1o6$1@spk-news1.nwnexus.com>

Alessandro Augusto <Alessandro.Augusto@br.bosch.com> wrote in message
news:3A3A3868.2CDAD4AD@br.bosch.com...
> sorry but I think you are confunsing everything.
>
> the question is not about at command. BTW, a normal user cannot
> schedule task with at. Only administrators are allowed to do it.
>
> The question here is:
> How do get the older owner, set the administrator as the owner,
> change some permissions of this object, then set back the original owner.
>
> How do I do that on a object (file or folder) that the administrator
> permissions
> were removed?

You don't. You cannot assign Ownership.

However, as Administrator you could use the AT command to copy the object
and then open/read that without leaving any trace. Or use it with CALCS to
add Admin=full to the object. I believe Klaus's point was that since AT runs
under the System account (def.), it can act on any file on the local machine
regardless of ownership. You could also pull the object off of the backup
tape, etc. There is almost no end to the ways this can be accomplished if
you have Admin access.

The bottom line is, if you can't trust your administrator you are f$cked.
And if as Admin you aren't trustworthy, you have no business in the job.
It's one position where ethics - and the appearance of ethical conduct - are
absolutely critical.

- AJS




------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5124
**************************************


home help back first fref pref prev next nref lref last post