<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023236" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023236</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/slow-computer-large-php-script#comment-1142925</link>
    <description> &lt;p&gt;Wish I had shell access, but I do not. This is running on my friends computer, he doesn&#039;t want to give out shell access unfortunatley. Thanks anyway, Mark. I&#039;ll check out forking, but it probably won&#039;t help as only one connection per IP is allowed every 60 seconds at least.&lt;/p&gt;
 </description>
     <pubDate>Wed, 17 Dec 2003 17:09:14 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1142925 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/slow-computer-large-php-script#comment-1142902</link>
    <description> &lt;p&gt;Hmmm... I don&#039;t think so.  But I didn&#039;t examine it closer than a single read-through.  It&#039;s your basic recursive function for directory browsing.  Not much you can do to optimize that.&lt;/p&gt;
&lt;p&gt;Of course, you could venture out into the world of forking (&lt;a href=&quot;http://www.php.net/manual/en/function.pcntl-fork.php&quot; class=&quot;bb-url&quot;&gt;link&lt;/a&gt;).  But I&#039;ve never been there, and I honestly am not sure if you would see any performance increase.  This is because I would assume each fork would need it&#039;s own FTP connection.&lt;/p&gt;
&lt;p&gt;You obviously have FTP access.  So can I assume you also have Telnet/SSH access?&lt;/p&gt;
&lt;p&gt;Not the prettiest thing, I know.  But it gives you the idea..&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;indent=3&lt;br /&gt;dir=`pwd`&lt;br /&gt;tab=$indent&lt;br /&gt;&lt;br /&gt;if [ $# -ge 1 ]; then&lt;br /&gt;	dir=$1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ $# -ge 2 ]; then&lt;br /&gt;	tab=$2&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;next=`expr $tab + $indent`&lt;br /&gt;&lt;br /&gt;ls -p $dir | grep &amp;#039;/&amp;#039; | grep -v &amp;#039;@&amp;#039; | while read i; do&lt;br /&gt;&amp;nbsp; echo &amp;quot;$dir/$i&amp;quot; $tab&lt;br /&gt;&amp;nbsp; ./list_mp3.sh &amp;quot;$dir/$i&amp;quot; $next&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;ls -lhp $dir | grep -v &amp;#039;/&amp;#039; | awk &amp;#039;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (NR&amp;gt;1) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf &amp;quot;%&amp;#039;$tab&amp;#039;s %sB\t%s\n&amp;quot;, &amp;quot; &amp;quot;, $5, $9&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;#039;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Wed, 17 Dec 2003 08:29:39 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1142902 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
