in reply to check if it is a file or directory
#!/usr/bin/perl use strict; use warnings; chdir('/path/to/oldFolder'); my @files = <*>; foreach my $file (@files) { if ( -f $file ) { print $file . " file \n"; } if ( -d $file ) { print $file . " directory \n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: check if it is a file or directory
by toolic (Bishop) on Feb 27, 2010 at 01:52 UTC | |
by saintex (Scribe) on Feb 27, 2010 at 07:22 UTC | |
by Khen1950fx (Canon) on Feb 27, 2010 at 11:16 UTC |