![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2001
Location: somewheres wet
Posts: 1,456
|
![]() 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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Macdaddy coder
Industry Role:
Join Date: Feb 2002
Location: MacDaddy pimp coder
Posts: 2,806
|
$dirname = '/etc';
if (-e $dirname) { print "yeah!\n"; }
__________________
MacDaddy Coder. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
♥♥♥ Likes Hugs ♥♥♥
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
|
if (-d $directory) {
blah }
__________________
I like pie. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
|
"-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.
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats." --H.L. Mencken |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jan 2001
Location: somewheres wet
Posts: 1,456
|
thanks guys, thats what i was looking for
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |