How to List Out All Files in a Directory

Files Listing Out from Directory

This Perl function is used to list out all the files in a specified directory

Perl Code to List Out Files from Dir


opendir(IMD, $dirtoget) || die("Cannot open directory");
@thefiles= readdir(IMD);
closedir(IMD);
print "Content-type: text/html

";
print "<html><body>";
foreach $f (@thefiles)
{
unless ( ($f eq ".") || ($f eq "..") )
{
print "$f<br />";
}
}



Related Topic SSH Secured Shell Configurations and Security Best Practices
What are all Common use of SSH for UNIX and Linux systems
JSP Page Directive for Translation Unit
Web Browser JSP plugin tag Elements Parameter Attributes
Basic Linux Commands
Perl  

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback