Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Changing owner of files: Windows vs Linux (or Why I hate Windows)

by ton (Friar)
on Apr 06, 2001 at 23:09 UTC ( #70562=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            // #includes omitted for the sake of sanity
            HANDLE token;
    ...
            if (security) free(security);
            if (sid) free(sid);
            return retValue;
    
  2. or download this
            my $filename = 'somefile';
            my $newuser = 'someuser';
    ...
            my $newuid = getpwname($newuser)[2];
            my $oldguid = stat($filename)[5];
            return ($newuid && chown($newuid, $oldguid, $filename));
    
  3. or download this
            my $filename = 'somefile';
            my $newuser = 'someuser';
    
            return getpwname($newuser) && chown(getpwnam($newuser)[2], sta
    +t($filename)[5], $filename);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://70562]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-02-18 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (79 votes). Check out past polls.

    Notices?