Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This might be an overkill, but I hope it helps: <pre><code>if(!is_readable($DirName)) { # Make sure the dir is readable before going on printf("You do not have permission to read:") ; printf("&lt;blockquote&gt;&lt;code&gt;\n%s\n&lt;/code&gt;&lt;/blockquote&gt;",$DirName) ; } else if(!is_dir($DirName)) { # Make sure it is a directory printf("The requested item is not a directory:") ; printf("&lt;blockquote&gt;&lt;code&gt;\n%s\n&lt;/code&gt;&lt;/blockquote&gt;",$DirName) ; } else if(($FileList = scandir($DirName))==FALSE) { # Are we able to scan the directory printf("&lt;h2&gt;Cannot get listing&lt;/h2&gt;\n") ; printf("Cannot get list of the contents of the directory:") ; printf("&lt;blockquote&gt;&lt;code&gt;\n%s\n&lt;/code&gt;&lt;/blockquote&gt;",$DirName) ; } else { $FileCount = sizeof($FileList) ; printf("Current working directory is:&lt;blockquote&gt;&lt;pre&gt;%s&lt;/pre&gt;&lt;/blockquote&gt;\n",posix_getcwd()) ; printf("Searching &lt;blockquote&gt;&lt;pre&gt;%s&lt;/pre&gt;&lt;/blockquote&gt;\n",$DirName) ; printf("&lt;ul&gt;\n") ; for($Count=0;$Count&lt;$FileCount &amp;&amp; $Count&lt;$CountLimit;$Count++) { printf("&lt;li&gt;%s&lt;/li&gt;\n",$FileList[$Count]) ; } # The number of files shown was limited by $CountLimit, if there are more files beyond what was shown above then show how many $Difference = $FileCount-$CountLimit ; if($Difference&gt;0) printf("&lt;li&gt;&lt;i&gt;&amp;hellip;%d more file%s/director%s&lt;/i&gt;&lt;/li&gt;",$Difference,$Difference==1?"":"s",$Difference==1?"y":"ies") ; printf("&lt;/ul&gt;\n") ; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload