Hello all. I am using Teamsite 5.5.2 on Windows and I was wondering how to detect whether or not a file encountered programmatically is a file or a folder/directory. I want to make sure that a given directory only contains subdirectories. If it contains a file then I want to ignore that file and only regard the subdirectories. Here's what I'm doing:
#Open the directory to search
opendir(DIR, "Y:/default/.../templatedata/article/data");
@files = readdir(DIR);
closedir(DIR);
#--- loop thru the data directory
foreach $file (
@files) {
#--- open the folders in the data directory
opendir(DIR1, "Y:/default/.../templatedata/article/data/$file");
@files1 = readdir(DIR1);
closedir(DIR1);
###### Here is where I need to determine if I've encountered a file or a folder ################
#--- make sure to exclude the directory markers.
if (($file ne ".") && ($file ne "..")) {
#more stuff...
Edited by rossnoe on 04/04/05 01:48 PM (server time).