Result:
found 1037 distributions and 1810 files matching your query ! ( run in 0.936 )


File-BSDGlob

 view release on metacpan or  search on metacpan

bsd_glob.c  view on Meta::CPAN

#ifdef I_PWD
#	include <pwd.h>
#else
#ifdef HAS_PASSWD
	struct passwd *getpwnam _((char *));
	struct passwd *getpwuid _((Uid_t));
#endif
#endif

#ifndef MAXPATHLEN
#  ifdef PATH_MAX

bsd_glob.c  view on Meta::CPAN

		 * handle a plain ~ or ~/ by expanding $HOME
		 * first and then trying the password file
		 */
		if ((h = getenv("HOME")) == NULL) {
#ifdef HAS_PASSWD
			if ((pwd = getpwuid(getuid())) == NULL)
				return pattern;
			else
				h = pwd->pw_dir;
#else
                        return pattern;

 view all matches for this distribution


File-BaseDir

 view release on metacpan or  search on metacpan

lib/File/BaseDir.pm  view on Meta::CPAN

  *_home    = sub { $ENV{USERPROFILE} || $ENV{HOMEDRIVE}.$ENV{HOMEPATH} || 'C:\\' };
}
else
{
  *_rootdir = sub { File::Spec->rootdir };
  *_home    = sub { $ENV{HOME} || eval { [getpwuid($>)]->[7] } || File::Spec->rootdir };
}

# OO method
sub new { bless \$VERSION, shift } # what else is there to bless ?

 view all matches for this distribution


File-Cache

 view release on metacpan or  search on metacpan

Cache.pm  view on Meta::CPAN

# by default, there is no max size to the cache

my $sDEFAULT_MAX_SIZE = $sNO_MAX_SIZE;


# if the OS does not support getpwuid, use this as a default username

my $sDEFAULT_USERNAME = 'nobody';


# by default, the objects in the cache never expire

Cache.pm  view on Meta::CPAN


    my $username;

    my $success = eval {
	my $effective_uid = $>;
	$username = getpwuid($effective_uid);	
    };

    if ($success and $username) {
	return $username;
    } else {

 view all matches for this distribution


File-Copy-clonefile

 view release on metacpan or  search on metacpan

lib/File/Copy/ppport.h  view on Meta::CPAN

GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu

lib/File/Copy/ppport.h  view on Meta::CPAN

KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu

 view all matches for this distribution


File-Dir-Dumper

 view release on metacpan or  search on metacpan

lib/File/Dir/Dumper/Scanner.pm  view on Meta::CPAN


BEGIN
{
    if (os_is('Unix'))
    {
        *_my_getpwuid =
            sub {
                my $uid = shift; return scalar(getpwuid($uid));
            };
        *_my_getgrgid =
            sub {
                my $gid = shift; return scalar(getgrgid($gid));
            };
    }
    else
    {
        *_my_getpwuid = sub { return "unknown"; };
        *_my_getgrgid = sub { return "unknown"; };
    }
}

sub _get_user_name

lib/File/Dir/Dumper/Scanner.pm  view on Meta::CPAN

    my $self = shift;
    my $uid = shift;

    if (!exists($self->_user_cache()->{$uid}))
    {
        $self->_user_cache()->{$uid} = _my_getpwuid($uid);
    }

    return $self->_user_cache()->{$uid};
}

 view all matches for this distribution


File-Find-Declare

 view release on metacpan or  search on metacpan

lib/File/Find/Declare.pm  view on Meta::CPAN

    my ($self, $file) = @_;
    
    if(!$self->has_owner()) { return 1; }
    
    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
    my $name = getpwuid($uid);
    
    foreach my $owner (@{$self->owner()}) {
        return 1 if $owner eq $uid || $owner eq $name;
    }
    

 view all matches for this distribution


File-Find-Node

 view release on metacpan or  search on metacpan

lib/File/Find/Node.pm  view on Meta::CPAN

        undef,  # POSTPROC
        undef,  # FILTER
        undef,  # ERRPROC
        undef,  # STAT
        undef,  # ARG
        {},     # USER  cache for getpwuid()
        {},     # GROUP cache for getgrgid()
        0       # MAXFORK
    ];
    $self->[NAME] =~ s{.*/}{};
    bless($self);

lib/File/Find/Node.pm  view on Meta::CPAN

    my $self = shift;
    my $uid = $self->uid;
    if (exists($self->[USER]->{$uid})) {
        return $self->[USER]->{$uid};
    }
    my $user = getpwuid($uid);
    $self->[USER]->{$uid} = defined($user) ? $user : $uid;
}

sub group {
    my $self = shift;

lib/File/Find/Node.pm  view on Meta::CPAN

Returns the user id number.

=item $f->user

Returns the user name or else returns the user id
number if getpwuid() fails.  Uses a cache to avoid
extra calls to getpwuid().

=item $f->gid

Returns the group id number.

 view all matches for this distribution


File-Finder

 view release on metacpan or  search on metacpan

t/05-steps.t  view on Meta::CPAN

  is_deeply([File::Finder->not->group(0+$()->in(qw(.))],
	    [fin(sub { $( != (stat)[5] }, '.')],
	    'not group');

  is_deeply([File::Finder->nouser->in(qw(.))],
	    [fin(sub { not defined getpwuid((stat)[4]) }, '.')],
	    'nouser');

  is_deeply([File::Finder->not->nouser->in(qw(.))],
	    [fin(sub { defined getpwuid((stat)[4]) }, '.')],
	    'not nouser');

  is_deeply([File::Finder->nogroup->in(qw(.))],
	    [fin(sub { not defined getgrgid((stat)[5]) }, '.')],
	    'nogroup');

 view all matches for this distribution


File-HomeDir

 view release on metacpan or  search on metacpan

lib/File/HomeDir/MacOS9.pm  view on Meta::CPAN

    }

    # Desperation on any platform
  SCOPE:
    {
        # On some platforms getpwuid dies if called at all
        local $SIG{'__DIE__'} = '';
        my $home = (getpwuid($<))[7];
        return $home if $home and -d $home;
    }

    Carp::croak("Could not locate current user's home directory");
}

 view all matches for this distribution


File-Information

 view release on metacpan or  search on metacpan

lib/File/Information.pm  view on Meta::CPAN

            return $self->{home} = $home if length($home);
        }
        return $self->{home} = 'C:\\';
    } else {
        return $self->{home} = $home if defined($home = $ENV{HOME}) && length($home);
        return $self->{home} = $home if defined($home = eval { [getpwuid($>)]->[7] }) && length($home);
        return $self->{home} = File::Spec->rootdir;
    }

    croak 'BUG';
}

 view all matches for this distribution


File-KDBX-XS

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu

ppport.h  view on Meta::CPAN

KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu

 view all matches for this distribution


File-KeePass-Agent

 view release on metacpan or  search on metacpan

lib/File/KeePass/Agent/unix.pm  view on Meta::CPAN

    $out =~ s{~/}{$self->home_dir.'/'}e;
    return length($out) ? $out : $def;
}

sub home_dir {
    my ($user,$passwd,$uid,$gid,$quota,$comment,$gcos,$home,$shell,$expire) = getpwuid($<);
    return $home || croak "Couldn't find home dir for uid $<";
}

sub _config_file {
    my $self = shift;

 view all matches for this distribution


File-LibMagic

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031010||Viu
get_regclass_nonbitmap_data|5.031010||Viu

ppport.h  view on Meta::CPAN

KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu

 view all matches for this distribution


File-Map

 view release on metacpan or  search on metacpan

lib/File/ppport.h  view on Meta::CPAN

GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu

lib/File/ppport.h  view on Meta::CPAN

KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu

 view all matches for this distribution


File-OSS-Scan

 view release on metacpan or  search on metacpan

lib/File/OSS/Scan.pm  view on Meta::CPAN

    working_dir     => getcwd() . "\/\.working",
    inflate         => UNI_FALSE,
);

my $options = undef;
my $user = getlogin() || ( getpwuid $< )[0];

sub scan_init {
    my %params = ( scalar(@_) != 1 ) ? @_ : ( 'ruleset_config' => $_[0] );

    # convert hash keys to lower case

 view all matches for this distribution


File-Path

 view release on metacpan or  search on metacpan

xt/setup_tests.pl  view on Meta::CPAN

  die 'Must provide uid of the user running tests as non-root'
    if not defined $opt{u};

  my ($uid, $gid) = $opt{u} =~ /\D/
      ? (getpwnam($opt{u}))[2,3]
      : (getpwuid($opt{u}))[2,3]
  ;

  create_dir($d, 0755);

  # directory EXTRA/1 could be deleted by a

 view all matches for this distribution


File-RsyBak

 view release on metacpan or  search on metacpan

script/rsybak  view on Meta::CPAN

#    my ($user, $slash) = @_;
#    my @ent;
#    if (length $user) {
#        @ent = getpwnam($user);
#    } else {
#        @ent = getpwuid($>);
#        $user = $ent[0];
#    }
#    return $ent[7] . $slash if @ent;
#    "~$user$slash"; 
#}

script/rsybak  view on Meta::CPAN

#    if ($^O eq 'MSWin32') {
#        return $ENV{USERNAME};
#    } else {
#        return $ENV{USER} if $ENV{USER};
#        my @pw;
#        eval { @pw = getpwuid($>) };
#        return $pw[0] if @pw;
#    }
#}
#
#sub _get_my_home_dir {

script/rsybak  view on Meta::CPAN

#        return join($ENV{HOMEDRIVE}, "\\", $ENV{HOMEPATH})
#            if $ENV{HOMEDRIVE} && $ENV{HOMEPATH};
#    } else {
#        return $ENV{HOME} if $ENV{HOME};
#        my @pw;
#        eval { @pw = getpwuid($>) };
#        return $pw[7] if @pw;
#    }
#
#    die "Can't get home directory";
#}

script/rsybak  view on Meta::CPAN

#    my ($name) = @_;
#
#    if ($^O eq 'MSWin32') {
#        return undef;
#    } else {
#        if ($name eq getpwuid($<)) {
#            return _get_my_home_dir();
#        }
#
#      SCOPE: {
#            my $home = (getpwnam($name))[7];

script/rsybak  view on Meta::CPAN

#        return join($ENV{HOMEDRIVE}, "\\", $ENV{HOMEPATH})
#            if $ENV{HOMEDRIVE} && $ENV{HOMEPATH};
#    } else {
#        return $ENV{HOME} if $ENV{HOME};
#        my @pw;
#        eval { @pw = getpwuid($>) };
#        return $pw[7] if @pw;
#    }
#
#    if ($DIE_ON_FAILURE) {
#        die "Can't get home directory";

script/rsybak  view on Meta::CPAN

#    my ($name) = @_;
#
#    if ($^O eq 'MSWin32') {
#        return undef;
#    } else {
#        if ($name eq getpwuid($<)) {
#            return get_my_home_dir();
#        }
#
#      SCOPE: {
#            my $home = (getpwnam($name))[7];

script/rsybak  view on Meta::CPAN

#        return join($ENV{HOMEDRIVE}, "\\", $ENV{HOMEPATH})
#            if $ENV{HOMEDRIVE} && $ENV{HOMEPATH};
#    } else {
#        return $ENV{HOME} if $ENV{HOME};
#        my @pw;
#        eval { @pw = getpwuid($>) };
#        return $pw[7] if @pw;
#    }
#    die "Can't get home directory";
#}
#

 view all matches for this distribution


File-Stat-Ls

 view release on metacpan or  search on metacpan

Ls.pm  view on Meta::CPAN

    my $fn = shift; 
    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
        $atime,$mtime,$ctime,$blksize,$blocks) = lstat $fn;
    my @a = lstat $fn; 
    my $dft = "%b %d  %Y";
    my $ud = getpwuid($uid);
    my $gd = getgrgid($gid); 
    my $fm = format_mode($mode); 
    my $mt = strftime $dft,localtime $mtime; 
    my $fmt = "%10s %3d %7s %4s %12d %12s %-26s\n";  
    return sprintf $fmt, $fm,$nlink,$ud,$gd,$size,$mt,$fn;

 view all matches for this distribution


File-Stat-OO

 view release on metacpan or  search on metacpan

lib/File/Stat/OO.pm  view on Meta::CPAN

    }
}

sub owner {
    my $self = shift;
    return (getpwuid($self->uid))[0];
}

sub group {
    my $self = shift;
    return (getgrgid($self->gid))[0];

 view all matches for this distribution


File-Tools

 view release on metacpan or  search on metacpan

lib/File/Tools.pm  view on Meta::CPAN


Normally the id command shows the current username, userid, group and gid.
In Perl one can access the current ireal UID as $<  and the effective UID as $>.
The real GID is $(  and the effective GID is $) of the current user.

To get the username and the group name use the getpwuid($uid) and getpwgrid($gid)
functions respectively in scalar context.


=cut

 view all matches for this distribution


File-Valet

 view release on metacpan or  search on metacpan

lib/File/Valet.pm  view on Meta::CPAN

        elsif (defined $username) {
            $env_home = $home_drive . '\\Users\\' . $username;
        }
        return $env_home if (defined $env_home && -d $env_home);
    } else {
        my @row = getpwuid($<);
        if (@row >= 9) {
          my $home_dir = $row[7];
          return $home_dir if (defined $home_dir && -d $home_dir);
        }
        return '/root' if (-d '/root' && -w '/root');

 view all matches for this distribution


File-XDG

 view release on metacpan or  search on metacpan

lib/File/XDG.pm  view on Meta::CPAN

        $self->{config}      = $ENV{XDG_CONFIG_HOME} || "$local\\.config\\";
        $self->{state}       = $ENV{XDG_STATE_HOME}  || "$local\\.local\\state\\";
        $self->{data_dirs}   = $ENV{XDG_DATA_DIRS}   || '';
        $self->{config_dirs} = $ENV{XDG_CONFIG_DIRS} || '';
    } else {
        my $home = $ENV{HOME} || [getpwuid($>)]->[7];
        $self->{home}        = $home;
        $self->{data}        = $ENV{XDG_DATA_HOME}   || "$home/.local/share/";
        $self->{cache}       = $ENV{XDG_CACHE_HOME}  || "$home/.cache/";
        $self->{state}       = $ENV{XDG_STATE_HOME}  || "$home/.local/state/";
        $self->{config}      = $ENV{XDG_CONFIG_HOME} || "$home/.config/";

 view all matches for this distribution


FileKGlob

 view release on metacpan or  search on metacpan

KGlob.pm  view on Meta::CPAN

	@alts=  m#(^|[^\\])(\\\\)*\{#  ?  &unbrac( $_ )  :  ( $_ );	 #}
	foreach(  @alts  ) {
	    if(  m#^~([^/]+)#  ) {	# Expand ~user to user's home directory:
		$user= $1 || getlogin();	# ~/ means "my" home directory
		$home= $1 ? ( (getpwnam($1))[7] || "~$user" )
			  : ( (getpwuid($<))[7] || $ENV{'HOME'} || "/" );
		s##$home#;
		# Replace "~user" with user's home directory (unless no such
		# user, then leave as is), unless is "~/" and getlogin()
		# failed, then try by current UID then $HOME then "/".
	    }

 view all matches for this distribution


Filesys-CygwinPaths

 view release on metacpan or  search on metacpan

lib/Filesys/CygwinPaths.pm  view on Meta::CPAN

  Carp::croak "Cannot understand your arg: $_[0] -- " unless
     $homey[0] =~/^~\w*\z/;
  # pattern ' m/^~(\w+)?/ ' is tilde with optional username
	 $homey[0] =~ s%^~(\w*)%$1 ?
		   ((getpwnam($1))[7] || "~$1")
		:   (getpwuid($>))[7]
		      %ex;
  return join( $pathsep, $homey[0],$homey[1] );
}

sub vetted_path {

 view all matches for this distribution


Filesys-Ext2

 view release on metacpan or  search on metacpan

ls2.pl  view on Meta::CPAN

    ]
  );
}

sub ui {
  ($u{$_[0]} ||= getpwuid($_[0]) || $_[0]),
    ($g{$_[1]} ||= getgrgid($_[1]) || $_[1]);
}

sub format_time {
  return $time{$_[0]} if exists $time{$_[0]};

 view all matches for this distribution


Filesys-Restrict

 view release on metacpan or  search on metacpan

easyxs/ppport.h  view on Meta::CPAN

GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu

easyxs/ppport.h  view on Meta::CPAN

KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu

 view all matches for this distribution


Filesys-Virtual-Plain

 view release on metacpan or  search on metacpan

Plain.pm  view on Meta::CPAN

	my %user;
	sub _user {
		my ($self, $uid) = @_;
		if (!exists($user{$uid})) {
			if (defined($uid)) {
				my $obj = getpwuid($uid);
				if ($obj) {
					$user{$uid} = $obj->name;
				} else {
					$user{$uid} = "#$uid";
				}

 view all matches for this distribution


Finance-Quant

 view release on metacpan or  search on metacpan

scripts/FINANCE_QUANT_CACHE  view on Meta::CPAN

sub tildeexp {
  my $path = shift;
  $path =~ s{^~([^/]*)} {  
          $1 
                ? (getpwnam($1))[7] 
                : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7])
          }ex;
  return $path;
}


 view all matches for this distribution


Firefox-Marionette

 view release on metacpan or  search on metacpan

lib/Firefox/Marionette.pm  view on Meta::CPAN

    if ( defined $parameters{host} ) {
        if ( $OSNAME eq 'MSWin32' ) {
            $parameters{user} ||= Win32::LoginName();
        }
        else {
            $parameters{user} ||= getpwuid $EFFECTIVE_USER_ID;
        }
        if ( $parameters{host} =~ s/:(\d+)$//smx ) {
            $parameters{port} = $1;
        }
        $parameters{port} ||= scalar getservbyname 'ssh', 'tcp';

lib/Firefox/Marionette.pm  view on Meta::CPAN

    {
        $user = Win32::LoginName();
        $host = 'localhost';
    }
    else {
        $user = getpwuid $EFFECTIVE_USER_ID;
        $host = 'localhost';
    }
    my $quoted_user = defined $user ? quotemeta $user : q[];
    if ( $self->_ssh() ) {
        $self->_initialise_remote_uname();

 view all matches for this distribution


( run in 0.936 second using v1.01-cache-2.11-cpan-47059a37de6 )