SPUG: perl newbie with annoying little issue ...

Yitzchak Scott-Thoennes sthoenna at efn.org
Tue Nov 28 17:30:57 CST 2000


On Tue, 28 Nov 2000, Joshua Lanza wrote:

> can anyone tell me how to determine if a file is a directory or a leaf? (i'm 
> looking for something similar to java's "isDirectory()" method in the File 
> class)

Use the built in file tests:
print 'file' if -f 'filename';
print 'dir' if -d 'filename';



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list