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.

HOME |  AJAX |  APACHE |  Bizphone |  CSS |  DNS |  General |  Graphics |  HTML |  Hardware |  Javascript |  Linux |  MAC |  MS SQL |  Mail |  Microsoft |  OFFICE 365 |  Perl |  Postgres |  SEO |  Social Media |  VMware |  Windows 10