gravindra1977
asked on
How do I find if a specific directory exists in a filesystem using perl
Hi,
I have a problem where I was asked to find if a particular directory exists in a filesystem. For example we have SunOS unix operating system which has /uXX filesystems. I need a perl script which would determine which all filesystems contain a directory called 'odsap1'.
Could anyone please provide with a perl script which would search all the filesystems and determine which all would contain this directory called, 'odsap1'.
Thanks in advance. Your help is really appreciated
I have a problem where I was asked to find if a particular directory exists in a filesystem. For example we have SunOS unix operating system which has /uXX filesystems. I need a perl script which would determine which all filesystems contain a directory called 'odsap1'.
Could anyone please provide with a perl script which would search all the filesystems and determine which all would contain this directory called, 'odsap1'.
Thanks in advance. Your help is really appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you really want to use Perl for such a simple task? Just type in
find / -type d -name odsap1
find / -type d -name odsap1
$dir = "/bla/bla";
if (-d $dir) {
print "$dir exist\n";
}
if (-d $dir) {
print "$dir exist\n";
}
http://search.cpan.org/~rgarcia/perl-5.10.0/lib/File/Find.pm