![]() |
directory exists? in perl
What is the correct way to find out if a directory exists in perl;
when readdir ->simply looking for a name without file extensions or is there another more accurate way? thx :) |
$dirname = '/etc';
if (-e $dirname) { print "yeah!\n"; } |
if (-d $directory) {
blah } |
"-e $directory" will tell you if "$directory" exists but not that it is a directory. "-d $directory" will tell you that $directory exists and that it is a directory.
|
thanks guys, thats what i was looking for:)
|
All times are GMT -7. The time now is 12:32 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123