#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    26
    Rep Power
    0
    Hi all

    I've got a list of strings, by opendir
    and i wanna check which of them are also directories,
    is there any functions in Perl can check this?

    I've tried these two methods, but it doesn't work......
    print "$file is a directoryn" if -d $file;
    @dir = grep -d, @files;

    a million thanksssssssss

    jan
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>if -d $file;

    Make sure $file has a full server path.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    26
    Rep Power
    0
    i.e. $file is a variable like
    "/public_html/home/myname/abc.txt/" ??
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Actually $file itself doesn't has to be full-server path, but you do need full server path for the -d, the directory test.

    You can try something like this:

    $mydir = "/home/myname/public_html";

    Then test it -d $mydir/$file;


IMN logo majestic logo threadwatch logo seochat tools logo