Name
SPVM::File::Basename::Instance - Parsing File Path into Directory and Base Name.
Description
SPVM::File::Basename::Instance
is the File::Basename::Instance
class in SPVM language.
This class parses a file path into a directory and a base name.
Usage
use File::Basename::Instance;
my $fb = File::Basename::Instance->new;
my $path = "dir/a.txt";
# fileparse
{
my $ret = $fb->fileparse($path);
# a.txt
my $base_name = $ret->[0];
# dir/
my $dir_name = $ret->[1];
}
# basename
{
# a.txt
my $base_name = $fb->basename($path);
}
# dirname
{
# dir
my $dir_name = $fb->dirname($path);
}
Class Methods
new
static method new : File::Basename::Instance ();
Instance Methods
fileparse
method fileparse : string[] ($path : string);
basename
method basename : string ($path : string);
dirname
method dirname : string ($path : string);
Well Known Child Classes
Repository
SPVM::File::Basename::Instance - Github
Author
Yuki Kimoto kimoto.yuki@gmail.com
Copyright & License
Copyright 2023-2023 Yuki Kimoto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.