www.fromthevalley.com.au

Split Directory Path/file up

#!/usr/bin/perl

use File::Spec;

$name = "/home/bob/test/perl_test/read_directory.pl";

($vol,$dir,$file)=File::Spec->splitpath($name);

print $vol."\n";
print $dir."\n";
print $file."\n";

 

 

 Very useful when automating directory management.

HOMEAJAXAPACHEBizphoneCSSDNSGeneralGraphicsHTMLHardwareJavascriptLinuxMACMS SQLMailMicrosoftOFFICE 365PerlPostgresSEOSocial MediaVMwareWindows 10