Server IP : 103.119.228.120 / Your IP : 3.140.196.5 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ssl/local/ssl/local/ssl/local/share/perl5/Path/Class/ |
Upload File : |
use strict; package Path::Class::Entity; { $Path::Class::Entity::VERSION = '0.37'; } use File::Spec 3.26; use File::stat (); use Cwd; use Carp(); use overload ( q[""] => 'stringify', 'bool' => 'boolify', fallback => 1, ); sub new { my $from = shift; my ($class, $fs_class) = (ref($from) ? (ref $from, $from->{file_spec_class}) : ($from, $Path::Class::Foreign)); return bless {file_spec_class => $fs_class}, $class; } sub is_dir { 0 } sub _spec_class { my ($class, $type) = @_; die "Invalid system type '$type'" unless ($type) = $type =~ /^(\w+)$/; # Untaint my $spec = "File::Spec::$type"; ## no critic eval "require $spec; 1" or die $@; return $spec; } sub new_foreign { my ($class, $type) = (shift, shift); local $Path::Class::Foreign = $class->_spec_class($type); return $class->new(@_); } sub _spec { (ref($_[0]) && $_[0]->{file_spec_class}) || 'File::Spec' } sub boolify { 1 } sub is_absolute { # 5.6.0 has a bug with regexes and stringification that's ticked by # file_name_is_absolute(). Help it along with an explicit stringify(). $_[0]->_spec->file_name_is_absolute($_[0]->stringify) } sub is_relative { ! $_[0]->is_absolute } sub cleanup { my $self = shift; my $cleaned = $self->new( $self->_spec->canonpath("$self") ); %$self = %$cleaned; return $self; } sub resolve { my $self = shift; Carp::croak($! . " $self") unless -e $self; # No such file or directory my $cleaned = $self->new( scalar Cwd::realpath($self->stringify) ); # realpath() always returns absolute path, kind of annoying $cleaned = $cleaned->relative if $self->is_relative; %$self = %$cleaned; return $self; } sub absolute { my $self = shift; return $self if $self->is_absolute; return $self->new($self->_spec->rel2abs($self->stringify, @_)); } sub relative { my $self = shift; return $self->new($self->_spec->abs2rel($self->stringify, @_)); } sub stat { File::stat::stat("$_[0]") } sub lstat { File::stat::lstat("$_[0]") } sub PRUNE { return \&PRUNE; } 1; __END__ =head1 NAME Path::Class::Entity - Base class for files and directories =head1 VERSION version 0.37 =head1 DESCRIPTION This class is the base class for C<Path::Class::File> and C<Path::Class::Dir>, it is not used directly by callers. =head1 AUTHOR Ken Williams, kwilliams@cpan.org =head1 SEE ALSO Path::Class =cut