Carrot
view release on metacpan or search on metacpan
lib/Carrot/Personality/Valued/File/Name.pm view on Meta::CPAN
}
sub require_type_directory_fatally
# /type method
# /effect ""
# //parameters
# //returns
{
my ($this) = @ARGUMENTS;
unless ($this->is_type_directory)
{
$translated_errors->advocate('not_a_directory', [$$this]);
}
return;
}
sub hierarchy_depth
# /type method
# /effect ""
# //parameters
# //returns
# ?
{
my ($this) = @ARGUMENTS;
my $canonified = $this->canonified;
return(scalar(split(
OS_FS_PATH_DELIMITER,
$canonified,
PKY_SPLIT_IGNORE_EMPTY_TRAIL)));
}
sub is_relative
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Boolean
{
return(substr(${$_[THIS]}, 0, 1) ne OS_FS_PATH_DELIMITER);
}
sub relative_name
# /type method
# /effect ""
# //parameters
# //returns
# ?
{
return((${$_[THIS]} =~ s{$re_parent_path}{}sro));
}
sub status
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Instance
{
return($status_class->constructor([stat(${$_[THIS]})]));
}
sub access_timestamp_is_newer
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_ATIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_ATIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 > $mtime1);
}
sub access_timestamp_is_equal
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_ATIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_ATIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 == $mtime1);
}
sub modification_timestamp_is_newer
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_MTIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_MTIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 > $mtime1);
}
sub modification_timestamp_is_equal
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_MTIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_MTIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 == $mtime1);
}
sub status_timestamp_is_newer
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_CTIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_CTIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 > $mtime1);
}
sub status_timestamp_is_equal
# /type method
# /effect ""
# //parameters
# that ::Personality::Abstract::Instance
# //returns
# ?
{
my ($exists1, $mtime1) = (-e ${$_[THIS]}, (stat(_))[RDX_STAT_CTIME]);
return (IS_UNDEFINED) unless ($exists1);
my ($exists2, $mtime2) = (-e ${$_[THAT]}, (stat(_))[RDX_STAT_CTIME]);
return (IS_UNDEFINED) unless ($exists2);
return($mtime2 == $mtime1);
}
sub has_extension
# /type method
# /effect ""
# //parameters
# name
# //returns
# ?
{
my ($this, $name) = @ARGUMENTS;
my $l = length($name)+1;
return(substr(${$_[THIS]}, -$l) eq ('.'.$name));
}
sub parent_directory
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Instance
{
if (${$_[THIS]} =~ m{$re_parent_path})
{
return($directory_name_class->constructor($1));
} else {
return(IS_UNDEFINED);
}
}
sub is_hidden_name
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Boolean
{
return(${$_[THIS]} =~ m{$re_hidden_name}o);
}
sub is_current_directory_name
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Boolean
{
return(${$_[THIS]} eq OS_FS_CURRENT_DIRECTORY);
}
sub is_parent_directory_name
# /type method
# /effect ""
# //parameters
# //returns
# ::Personality::Abstract::Boolean
( run in 1.641 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )