<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean Behan&#039;s Web Development Portfolio and Blog &#187; directories</title>
	<atom:link href="http://seanbehan.com/tag/directories/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Development, Wordpress, Moodle, Ruby on Rails and Design in Burlington, Vermont</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:17:12 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Listing Files and Directories with PHP</title>
		<link>http://seanbehan.com/php/listing-files-and-directories-with-php/</link>
		<comments>http://seanbehan.com/php/listing-files-and-directories-with-php/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:27:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[directories]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[ksort]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[stat]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=774</guid>
		<description><![CDATA[Listing all files and directories using PHP 5.

&#60;?php
$files = array(); $dir = dir(".");
while(false!==($file=$dir-&#62;read())):
  if(($file{0}!=".") &#038;&#038; ($file{0}!="~") &#038;&#038; (substr($file, -3)!="LCK")
    &#038;&#038; ($file!=basename($_SERVER["PHP_SELF"]))):
      $files[$file] = stat($file); //
    endif;
endwhile;
$dir-&#62;close(); ksort($files); ?&#62;

&#60;table border=1 cellpadding=5&#62;
&#60;tr&#62;&#60;th&#62;Name&#60;/th&#62;&#60;th&#62;Size&#60;/th&#62;&#60;th&#62;Date&#60;/th&#62;&#60;/tr&#62;
&#60;?php foreach($files as $name =&#62; $stats): ?&#62;
  &#60;tr&#62;
    &#60;td&#62;&#60;?php print [...]


Related posts:<ol><li><a href='http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/' rel='bookmark' title='Permanent Link: Reading, Writing, Removing Files and Directories in Ruby'>Reading, Writing, Removing Files and Directories in Ruby</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Listing all files and directories using PHP 5.</p>
<pre>
&lt;?php
$files = array(); $dir = dir(".");
while(false!==($file=$dir-&gt;read())):
  if(($file{0}!=".") &#038;&#038; ($file{0}!="~") &#038;&#038; (substr($file, -3)!="LCK")
    &#038;&#038; ($file!=basename($_SERVER["PHP_SELF"]))):
      $files[$file] = stat($file); //
    endif;
endwhile;
$dir-&gt;close(); ksort($files); ?&gt;

&lt;table border=1 cellpadding=5&gt;
&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt;&lt;th&gt;Date&lt;/th&gt;&lt;/tr&gt;
&lt;?php foreach($files as $name =&gt; $stats): ?&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;?php print $name;?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php print $stats['size']; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php print date("m-d-Y h:ia", $stats['mtime']); ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;?php endforeach; ?&gt;&lt;/table&gt;
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/' rel='bookmark' title='Permanent Link: Reading, Writing, Removing Files and Directories in Ruby'>Reading, Writing, Removing Files and Directories in Ruby</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
<li><a href='http://seanbehan.com/programming/recursively-zip-up-a-directory-while-excluding-certain-files/' rel='bookmark' title='Permanent Link: Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type'>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/php/listing-files-and-directories-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading, Writing, Removing Files and Directories in Ruby</title>
		<link>http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/</link>
		<comments>http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 22:34:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[directories]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[io]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=625</guid>
		<description><![CDATA[These aren&#8217;t all of them, but I think they are some of the most useful. 

# making a directory in another directory that doesn't yet exist...
FileUtils.mkdir_p '/path/to/your/directory/that/doesnt/exist/yet'

# recursively remove a directory and the contents
FileUtils.rm_rf("/path/to/directory/you/want/to/delete")

# write a file from the contents of another file...
File.open("/path/to/the/file.ext", "wb") {&#124;f&#124; f.write(@your_other_file.read)}



Related posts:Listing Files and Directories with PHP
Recursively Zip a Directory [...]


Related posts:<ol><li><a href='http://seanbehan.com/php/listing-files-and-directories-with-php/' rel='bookmark' title='Permanent Link: Listing Files and Directories with PHP'>Listing Files and Directories with PHP</a></li>
<li><a href='http://seanbehan.com/linux/recursively-zip-a-directory-and-files-on-linux/' rel='bookmark' title='Permanent Link: Recursively Zip a Directory and Files on Linux'>Recursively Zip a Directory and Files on Linux</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>These aren&#8217;t all of them, but I think they are some of the most useful. </p>
<pre>
# making a directory in another directory that doesn't yet exist...
FileUtils.mkdir_p '/path/to/your/directory/that/doesnt/exist/yet'

# recursively remove a directory and the contents
FileUtils.rm_rf("/path/to/directory/you/want/to/delete")

# write a file from the contents of another file...
File.open("/path/to/the/file.ext", "wb") {|f| f.write(@your_other_file.read)}
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/php/listing-files-and-directories-with-php/' rel='bookmark' title='Permanent Link: Listing Files and Directories with PHP'>Listing Files and Directories with PHP</a></li>
<li><a href='http://seanbehan.com/linux/recursively-zip-a-directory-and-files-on-linux/' rel='bookmark' title='Permanent Link: Recursively Zip a Directory and Files on Linux'>Recursively Zip a Directory and Files on Linux</a></li>
<li><a href='http://seanbehan.com/linux/add-user-directories-to-apache2-web-server/' rel='bookmark' title='Permanent Link: Add User Directories to Apache2 Web Server'>Add User Directories to Apache2 Web Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/reading-writing-removing-files-and-directories-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
