Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58882 - in sandbox/filesystem-v3: boost/filesystem libs/filesystem/doc libs/filesystem/example libs/filesystem/test libs/filesystem/test/msvc/tut0 libs/filesystem/test/msvc/tut1 libs/filesystem/test/msvc/tut2 libs/filesystem/test/msvc/tut3 libs/filesystem/test/msvc/tut4 libs/filesystem/tutorial
From: bdawes_at_[hidden]
Date: 2010-01-10 16:12:40


Author: bemandawes
Date: 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
New Revision: 58882
URL: http://svn.boost.org/trac/boost/changeset/58882

Log:
Work-in-progress
Added:
   sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp (contents, props changed)
   sandbox/filesystem-v3/libs/filesystem/example/tut0.cpp
      - copied unchanged from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp
   sandbox/filesystem-v3/libs/filesystem/example/tut1.cpp
      - copied unchanged from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp
   sandbox/filesystem-v3/libs/filesystem/example/tut2.cpp
      - copied unchanged from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp
   sandbox/filesystem-v3/libs/filesystem/example/tut3.cpp
      - copied unchanged from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp
   sandbox/filesystem-v3/libs/filesystem/example/tut4.cpp
      - copied, changed from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp
Removed:
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut1_crash.jpg
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp
   sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp
Text files modified:
   sandbox/filesystem-v3/boost/filesystem/path.hpp | 16
   sandbox/filesystem-v3/libs/filesystem/doc/do_list.html | 3
   sandbox/filesystem-v3/libs/filesystem/doc/reference.html | 106 ++++----
   sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html | 466 ++++++++++++++++++++++++++++++++-------
   sandbox/filesystem-v3/libs/filesystem/doc/v3.html | 8
   sandbox/filesystem-v3/libs/filesystem/example/Jamfile.v2 | 19 +
   sandbox/filesystem-v3/libs/filesystem/example/file_size.cpp | 2
   sandbox/filesystem-v3/libs/filesystem/example/tut4.cpp | 13
   sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp | 2
   sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj | 2
   sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj | 2
   sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj | 2
   sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj | 2
   sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj | 2
   14 files changed, 485 insertions(+), 160 deletions(-)

Modified: sandbox/filesystem-v3/boost/filesystem/path.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/path.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/path.hpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -209,13 +209,13 @@
     path& remove_filename();
     path& replace_extension(const path& new_extension = path());
 
-# ifdef BOOST_WINDOWS_API
+# ifdef BOOST_POSIX_API
 
- path& localize(); // change slash to backslash
+ path& localize() { return *this; } // POSIX m_path already localized
 
-# else // BOOST_POSIX_API
+# else // BOOST_WINDOWS_API
 
- path& localize() { return *this; } // POSIX m_path already localized
+ path& localize(); // change slashes to backslashes
 
 # endif
 
@@ -228,15 +228,15 @@
 
     // Implementations are permitted to return const values or const references.
 
- // The string or path returned by an observer will be described as being formatted
- // as "native" or "portable".
+ // The string or path returned by an observer are specified as being formatted
+ // as "native" or "generic".
     //
     // For POSIX, these are all the same format; slashes and backslashes are as input and
     // are not modified.
     //
     // For Windows, native: as input; slashes and backslashes are not modified;
     // this is the format of the internally stored string.
- // portable: backslashes are converted to slashes
+ // generic: backslashes are converted to slashes
 
 // template< class T >
 // T string(system::error_code & ec = boost::throws()) const // internal (i.e. original) format
@@ -271,7 +271,7 @@
 
 # endif
 
- // ----- portable format observers -----
+ // ----- generic format observers -----
 
 # ifdef BOOST_WINDOWS_API
 

Modified: sandbox/filesystem-v3/libs/filesystem/doc/do_list.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/do_list.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/do_list.html 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -20,8 +20,11 @@
 <h2>Docs</h2>
 <ul>
   <li><font size="4">Finish Rev 0 of tutorial</font></li>
+ <li>Reorganize files</li>
   <li>Fix broken links.</li>
+ <li>Create Jamfile for examples</li>
   <li>Review FAQ.</li>
+ <li>Review Index.html</li>
   <li>Should minimal.css be changed to used relative font sizes? See
   <a href="http://www.w3schools.com/CSS/pr_font_font-size.asp/">http://www.w3schools.com/CSS/pr_font_font-size.asp\</a></li>
   <li>Document behavior of path::replace_extension has change WRT argument w/o a

Modified: sandbox/filesystem-v3/libs/filesystem/doc/reference.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/reference.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/reference.html 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -371,6 +371,9 @@
       path system_complete(const path&amp; p);
       path system_complete(const path&amp; p, system::error_code&amp; ec);
 
+ path unique_path(const path&amp; model=&quot;%%%%-%%%%-%%%%-%%%%&quot;);
+ path unique_path(const path&amp; model, system::error_code&amp; ec);
+
     } // namespace filesystem
   } // namespace boost</pre>
 <h4><a name="Error-reporting">Error reporting</a></h4>
@@ -424,18 +427,9 @@
 </ul>
 <h3><a name="class-path">Class <code>path</code></a></h3>
 <p>An object of class <code>path</code> represents a path,
-and contains a pathname in th<span style="background-color: #FF0000">e
-</span>
-native format<span style="background-color: #FF0000">.</span> Such an object is concerned only with the lexical and syntactic aspects
-of a path. The path does not have to actually exist in the operating system's file
-systems, and may contain pathnames which are not even valid for the current operating
+and contains a pathname Such an object is concerned only with the lexical and syntactic aspects
+of a path. The path may not actually exist in external storage, and may contain pathnames which are not even valid for the current operating
 system. </p>
-<blockquote>
- <p>[<i>Note: </i>If the library's operational functions trafficked only in C++<i> </i>or
- C-style strings rather than <code>path</code> objects, it would provide only the illusion of portability since
- while the syntax of function calls would be portable, the semantics of the
- strings they operate on would not be portable. <i>-- end note</i>]</p>
-</blockquote>
 <pre> namespace boost
   {
     namespace filesystem
@@ -484,7 +478,7 @@
         path&amp; replace_extension(const path&amp; new_extension = path());
         path&amp; localize(); // POSIX: no effect. Windows: convert slashes to backslashes
 
- // observers
+ // native format observers
         const string_type&amp; native() const; // native format, encoding
         const value_type* c_str() const; // native().c_str()
 
@@ -493,7 +487,8 @@
         const u16string native_u16string() const; // ditto
         const u32string native_u32string() const; // ditto
 
- const string string() const; // portable format, uses codecvt() for encoding
+ // generic format observers
+ const string string() const; // generic format, uses codecvt() for encoding
         const wstring wstring() const; // ditto
         const u16string u16string() const; // ditto
         const u32string u32string() const; // ditto
@@ -575,25 +570,25 @@
   <li>A <code>boost::filesystem::directory_entry</code>.</li>
 </ul>
 <h4><a name="Pathname-formats">Pathname formats</a></h4>
-<p>Strings representing paths may be in two possible formats: </p>
+<p>Pathnames are in two possible formats: </p>
 <ul>
- <li><i><b><a name="Portable-pathname-format">Portable pathname format</a>:</b></i> As described in <a href="#Pathname-grammar">
+ <li><a name="Portable-pathname-format"><b><i>Generic</i></b></a><i><b><a name="Portable-pathname-format"> pathname format</a>:</b></i> As described in <a href="#Pathname-grammar">
   Pathname grammar</a> and by the <i>POSIX</i> <i>Filename,
 <a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_266">
 Pathname</a> </i>and<i>
 <a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap04.html#tag_04_11">
 Pathname Resolution</a></i> definitions.<blockquote>
 <p>[<i>Note:</i> <span style="background-color: #FFFFFF">The <i>POSIX</i> format
-is the basis for the portable format because it is already part of an ISO standard, is
+is the basis for the generic format because it is already part of an ISO standard, is
 the basis for the ubiquitous <i>URL</i> format, and is the native pathname format
 (or a
 subset thereof) for the <i>UNIX</i>-like and <i>Windows</i>-like
 pathnames familiar to most programmers. </span></p>
-<p>Use of the portable format does not alone guarantee
+<p>Use of the generic format does not guarantee
 portability; filenames must also be portable.<span style="background-color: #FFFFFF">
 See Filename conversions. Each operating system
  
-follows its own rules. Use of the portable format
+follows its own rules. Use of the generic format
 does not change those rules. </span> <i>-- end note</i>]</p>
   </blockquote>
   
@@ -602,9 +597,8 @@
   
   <b><i><a name="Native-pathname-format">Native pathname format</a>:</i></b> As defined by the operating system.<blockquote>
     <p>[<i>Note:</i> <span style="background-color: #FFFFFF">Working with
- user-provided paths in the native format is a common need.</span></p>
- <p><span style="background-color: #FFFFFF">Programs using hard-coding native
- formats may not be portable.&nbsp; --</span><i><span style="background-color: #FFFFFF"> end note</span></i><span style="background-color: #FFFFFF">]</span></p>
+ user-provided native format paths is a common need. Hard-coded native
+ format paths, however, may not be portable.&nbsp; --</span><i><span style="background-color: #FFFFFF"> end note</span></i><span style="background-color: #FFFFFF">]</span></p>
   </blockquote>
   </li>
 </ul>
@@ -612,14 +606,13 @@
   <table border="1" cellpadding="10" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
     <tr>
       <td bgcolor="#D7EEFF">
- <p align="left">[<i>Note:</i></p>
- <p align="left"><b>POSIX-like<i> </i>implementations, including Cygwin:</b>
- The portable format and the native format are the same, and the encoding
+ <p align="left">[<i>Note:</i><b> POSIX-like<i> </i>implementations, including Cygwin:</b>
+ The native format is the same as the generic format. The pathname encoding
     follows the conventions of the specific operating system</p>
- <p align="left"><b>Windows-like implementations:</b> The native format is
+ <p align="left"><b>Windows-like implementations, including MinGW:</b> The native format is
     the Windows pathname format, and the encoding is UTF-16 (UCS-2 for older
- versions). The native directory separator is a backslash, but a slash is
- also acceptable. Since the portable format is a subset of the native format,
+ versions). The preferred native directory separator character is the backslash, but slash is
+ also acceptable. Since the generic format is a subset of the native format,
     no reformatting is required and directory separators are preserved. For
     example, on Windows:</p>
       <blockquote>
@@ -634,7 +627,7 @@
   </table>
 </div>
 <p><span style="background-color: #FFFF00">All <code>path</code> string or sequence arguments that describe a
-path shall accept the portable pathname format, and shall accept the native
+path shall accept the generic pathname format, and shall accept the native
 format if explicitly identified by a native format escape sequence prefix of
 <code>slash slash colon</code>.</span></p>
 <blockquote>
@@ -656,13 +649,13 @@
 <p><i><span style="background-color: #FFFF00">-- OpenVMS:</span></i><span style="background-color: #FFFF00">
 </span> <code><span style="background-color: #FFFF00">&quot;SYS1::DISK1:[JANE.TYLER.HARRY]</span></code><span style="background-color: #FFFF00">&quot; is treated
 as a native pathname with a system name, drive name,&nbsp;and three directory
-filenames, rather than a portable pathname with one filename.</span></p>
+filenames, rather than a generic pathname with one filename.</span></p>
 <p><i><span style="background-color: #FFFF00">-- Windows: </span> </i><code>
 <span style="background-color: #FFFF00">&quot;c:\\jane\\tyler\\harry&quot;</span></code><span style="background-color: #FFFF00"> is treated as a
 native pathname with a drive letter, root-directory, and three filenames, rather
-than a portable pathname with one filename.</span></p>
+than a generic pathname with one filename.</span></p>
 <p><i><span style="background-color: #FFFF00">-- Counter-example 1:</span></i><span style="background-color: #FFFF00"> An operating system that allows slashes in
-filenames and uses dot as a directory separator. Distinguishing between portable
+filenames and uses dot as a directory separator. Distinguishing between generic
 and native format argument strings or sequences is not possible as there is no
 other distinguishing syntax. The implementation does not accept native format
 pathnames unless the </span> <code><span style="background-color: #FFFF00">native</span></code><span style="background-color: #FFFF00"> argument is present.</span></p>
@@ -678,17 +671,17 @@
 eliminates format confusion as a source of programmer error and support
 requests. </span> <i><span style="background-color: #FFFF00">-- end note</span></i><span style="background-color: #FFFF00">]</span></p>
 </blockquote>
-<p><span style="background-color: #FFFF00">If both the portable and native formats are accepted, implementations shall
+<p><span style="background-color: #FFFF00">If both the generic and native formats are accepted, implementations shall
 document what characters or character sequences are used to distinguish between
-portable and native formats.</span></p>
+two formats.</span></p>
 <blockquote>
 <p><span style="background-color: #FFFF00">[</span><i><span style="background-color: #FFFF00">Note:</span></i><span style="background-color: #FFFF00">
 </span> <i><span style="background-color: #FFFF00">Windows</span></i><span style="background-color: #FFFF00"> implementations are encouraged to define colons
-and backslashes as the characters which distinguish native from portable
+and backslashes as the characters which distinguish native from generic
 formats. </span> <i><span style="background-color: #FFFF00">--end note</span></i><span style="background-color: #FFFF00">]</span></p>
 </blockquote>
 <h4><a name="Pathname-grammar">Pathname grammar</a></h4>
-<p>The grammar for the portable pathname format is as follows:</p>
+<p>The grammar for the generic pathname format is as follows:</p>
 <blockquote>
 <p><i>pathname:<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root-name<sub>opt</sub>
@@ -728,15 +721,26 @@
 <blockquote>
 <p><span style="background-color: #E0E0E0"><i>The form of the above wording was taken
 from POSIX, which uses it in several places to defer to the C standard.</i></span></p>
-<p>[<i>Note: Windows</i> implementations are encouraged to define <i>slash slash
-name</i> as a permissible <i>root-name</i>. <i>POSIX</i> permits, but does not
-require, implementations to do the same. <i>Windows</i> implementations are
-encouraged to define an additional <i>root-directory</i> element <i>
-root_directory name.</i> It is applicable only to the <i>slash slash name</i>
-form of <i>root-name.</i></p>
-<p> <i>Windows</i> implementations are encouraged to recognize a <i>name</i>
-followed by a colon as a native format <i>root-name</i>,
-and a backslash as a format element equivalent to <i>slash</i>. <i>-- end note</i>]</p>
+<p><span style="background-color: #FFFF00">[</span><i><span style="background-color: #FFFF00">Note: Windows</span></i><span style="background-color: #FFFF00"> implementations are encouraged to define
+</span> <i><span style="background-color: #FFFF00">slash slash
+name</span></i><span style="background-color: #FFFF00"> as a permissible </span> <i>
+<span style="background-color: #FFFF00">root-name</span></i><span style="background-color: #FFFF00">.
+</span> <i><span style="background-color: #FFFF00">POSIX</span></i><span style="background-color: #FFFF00"> permits, but does not
+require, implementations to do the same. </span> <i>
+<span style="background-color: #FFFF00">Windows</span></i><span style="background-color: #FFFF00"> implementations are
+encouraged to define an additional </span> <i>
+<span style="background-color: #FFFF00">root-directory</span></i><span style="background-color: #FFFF00"> element
+</span> <i>
+<span style="background-color: #FFFF00">root_directory name.</span></i><span style="background-color: #FFFF00"> It is applicable only to the
+</span> <i><span style="background-color: #FFFF00">slash slash name</span></i><span style="background-color: #FFFF00">
+form of </span> <i><span style="background-color: #FFFF00">root-name.</span></i></p>
+<p> <i><span style="background-color: #FFFF00">Windows</span></i><span style="background-color: #FFFF00"> implementations are encouraged to recognize a
+</span> <i><span style="background-color: #FFFF00">name</span></i><span style="background-color: #FFFF00">
+followed by a colon as a native format </span> <i>
+<span style="background-color: #FFFF00">root-name</span></i><span style="background-color: #FFFF00">,
+and a backslash as a format element equivalent to </span> <i>
+<span style="background-color: #FFFF00">slash</span></i><span style="background-color: #FFFF00">.
+</span> <i><span style="background-color: #FFFF00">-- end note</span></i><span style="background-color: #FFFF00">]</span></p>
 </blockquote>
 <h4><a name="Input-conversion">Input conversion</a></h4>
 <p><span style="background-color: #FFFF00">To be supplied. Explain when, how
@@ -884,8 +888,8 @@
   backslashes. On POSIX, there is no effect. <i>-- end note</i>]</p>
   <p><i>Returns:</i> <code>*this</code></p>
 </blockquote>
-<h4> <code><font size="4">class </font></code> <a name="path-observers"> <code>
-<font size="4">path</font></code> observers</a></h4>
+<h4> <a name="path-observers"> <code>
+<font size="4"><span style="background-color: #FFFF00">path native format</span></font></code><span style="background-color: #FFFF00"> observers</span></a></h4>
 <p><span style="background-color: #FFFF00"><i>Move elsewhere.</i> </span></p>
 <p><span style="background-color: #FFFF00">Some operating systems, including
 </span> <i><span style="background-color: #FFFF00">POSIX</span></i><span style="background-color: #FFFF00"> and
@@ -958,7 +962,7 @@
 <p><b><i><code>const-string</code></i></b> is permitted to be <code>const
 std::string</code> or <code>const std::string&amp;</code>.</p>
 <p><i>Returns:</i> The contained pathname, in the
-portable pathname format.</p>
+generic pathname format.</p>
 <p><i>Remarks:</i> If
 <code>value_type</code> is not <code>char</code>, the encoding is converted by
 <code>codecvt()</code>.</p>
@@ -968,7 +972,7 @@
 <p><b><i><code>const-wstring</code></i></b> is permitted to be <code>const
 std::wstring</code> or <code>const std::wstring&amp;</code>.</p>
 <p><i>Returns:</i> The contained pathname, in the
-portable pathname format.</p>
+generic pathname format.</p>
 <p><i>Remarks:</i> If
 <code>value_type</code> is not <code>wchar_t</code>, the encoding is converted by
 <code>codecvt()</code>.</p>
@@ -1537,8 +1541,8 @@
 <p><span style="background-color: #E0E0E0"><i>Actual cold-boot timing of iteration over
 a directory with 15,047 entries was six seconds for non-cached status queries
 versus one second for cached status queries. Windows XP, 3.0 GHz processor, with
-a moderately fast hard-drive. Similar speedup expected on Linux and BSD-derived
-Unix variants that provide status during directory iteration.</i></span></p>
+a moderately fast hard-drive. Similar speedups are expected on Linux and BSD-derived
+systems that provide status as a by-product of directory iteration.</i></span></p>
 </blockquote>
 <h4> <a name="directory_entry-constructors"> <code>directory_entry </code>constructors</a></h4>
 <pre>directory_entry();</pre>
@@ -3397,7 +3401,7 @@
 <p>Distributed under the Boost Software License, Version 1.0. See
 <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->06 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32144" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->07 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32146" --></p>
 
 </body>
 

Modified: sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -135,7 +135,7 @@
 do not throw exceptions when I/O errors occur.
   <span style="background-color: #FFFF00">More on that later in the tutorial.</span></p>
 
-<h2>File size - tut1.cpp</h2>
+<h2>tut1.cpp - Reporting the size of a file</h2>
 
 <p>Let's develop a little command line program to list information about
 files and directories - essentially a much simplified version of the POSIX <code>ls</code> or Windows <code>dir</code>
@@ -151,7 +151,7 @@
 <table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
   <tr>
     <td style="font-size: 10pt">
- <pre>tut1.cpp</pre>
+ <pre>tut1.cpp</pre>
     <blockquote>
       <pre>int main(int argc, char* argv[])
 {
@@ -198,9 +198,9 @@
   <br>
   There's no file named <code>foo</code> in the current directory, so again an
 exception was thrown.</p>
- <p>We'll deal with those conditions in tut2.cpp.</p>
+ <p>We'll deal with those conditions in <code>tut2.cpp</code>.</p>
 
-<h2>tut2.cpp - Using status queries to determine file existence and type</h2>
+<h2>tut2.cpp - Using status queries to determine file existence and type</h2>
 
 <p>Boost.filesystem includes status query functions such as <code>exists</code>,
 <code>is_directory</code>, and <code>is_regular_file</code>. These all return
@@ -214,7 +214,7 @@
 <table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
   <tr>
     <td style="font-size: 10pt">
- <pre>tut2.cpp</pre>
+ <pre>tut2.cpp</pre>
     <blockquote style="font-size: 10pt">
       <pre>int main(int argc, char* argv[])
 {
@@ -245,20 +245,27 @@
 
 <p>This works fine - give it a try yourself. However, the output is less than
 satisfactory a directory because we'd typically like to see its contents. Move
-on to tut3.cpp to see how to iterate over directories.</p>
+on to <code>tut3.cpp</code> to see how to iterate over directories.</p>
 
-<h2>tut3.cpp - Directory iteration</h2>
+<h2>tut3.cpp - Directory iteration</h2>
 
 <p>Boost.Filesystem's <code><a href="reference.html#directory_iterator">
-directory_iterator</a></code> class is just what we need here. Constructed from
-a path, it iterates over the contents of the directory. The value type is
-directory_entry, which
-can be used for function arguments requiring a <code>path</code>.</p>
+directory_iterator</a></code> class is just what we need here. It follows the
+general pattern of the standard library's <code>istream_iterator</code>. Constructed from
+a path, it iterates over the contents of the directory. A default constructed <code>directory_iterator</code>
+acts as the end iterator.</p>
+
+<p>The value type of <code>directory_iterator</code> is <code>
+directory_entry</code>. A <code>
+directory_entry</code> contains a <code>path</code> and symlink/non-symlink
+resolving <code>file_status</code>
+caches, and
+can be passed to <code>path</code> arguments in function calls.</p>
 
 <table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
   <tr>
     <td style="font-size: 10pt">
- <pre>tut3.cpp</pre>
+ <pre>tut3.cpp</pre>
     <blockquote>
       <pre>int main(int argc, char* argv[])
 {
@@ -300,13 +307,47 @@
   </tr>
 </table>
 
-<p>Give tut3 a try, passing it a path to a directory as a command line argument.
-Here is a run on a Boost Subversion trunk checkout:</p>
+<p>Give <code>tut3</code> a try, passing it a path to a directory as a command line argument.
+Here is a run on a checkout of the Boost Subversion trunk:</p>
 
-<blockquote>
- <pre>C:\v3d&gt;tut3 c:\boost\trunk
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./tut3 ~/boost/trunk
+/home/beman/boost/trunk: is a directory containing:
+/home/beman/boost/trunk/tools
+/home/beman/boost/trunk/boost-build.jam
+/home/beman/boost/trunk/dist
+/home/beman/boost/trunk/doc
+/home/beman/boost/trunk/bootstrap.sh
+/home/beman/boost/trunk/index.html
+/home/beman/boost/trunk/bin.v2
+/home/beman/boost/trunk/bootstrap.bat
+/home/beman/boost/trunk/boost.css
+/home/beman/boost/trunk/INSTALL
+/home/beman/boost/trunk/rst.css
+/home/beman/boost/trunk/boost
+/home/beman/boost/trunk/people
+/home/beman/boost/trunk/wiki
+/home/beman/boost/trunk/boost.png
+/home/beman/boost/trunk/LICENSE_1_0.txt
+/home/beman/boost/trunk/more
+/home/beman/boost/trunk/Jamroot
+/home/beman/boost/trunk/.svn
+/home/beman/boost/trunk/libs
+/home/beman/boost/trunk/index.htm
+/home/beman/boost/trunk/status
+/home/beman/boost/trunk/CMakeLists.txt</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>&gt;tut3 c:\boost\trunk
 c:\boost\trunk: is a directory containing:
    c:\boost\trunk\.svn
+ c:\boost\trunk\bin.v2
    c:\boost\trunk\boost
    c:\boost\trunk\boost-build.jam
    c:\boost\trunk\boost.css
@@ -314,6 +355,7 @@
    c:\boost\trunk\bootstrap.bat
    c:\boost\trunk\bootstrap.sh
    c:\boost\trunk\CMakeLists.txt
+ c:\boost\trunk\dist
    c:\boost\trunk\doc
    c:\boost\trunk\index.htm
    c:\boost\trunk\index.html
@@ -327,83 +369,345 @@
    c:\boost\trunk\status
    c:\boost\trunk\tools
    c:\boost\trunk\wiki</pre>
+ </td>
+ </tr>
+ </table>
+
+<h2>tut4.cpp - Using a patch decomposition
+function</h2>
+
+<p>It might be clearer to output just the filename, without the parent path. Class
+<code>path</code> has a decomposition function to extract the filename, so
+that's easy to try. Just change</p>
+<blockquote>
+ <pre>cout &lt;&lt; &quot; &quot; &lt;&lt; *it &lt;&lt; '\n';</pre>
+</blockquote>
+<p>to</p>
+<blockquote>
+ <pre>cout &lt;&lt; &quot; &quot; &lt;&lt; it-&gt;path().filename() &lt;&lt; '\n'; </pre>
 </blockquote>
-<p>It would be nice to output just the filename, without the parent path. Class
-<code>path</code> has functions to do just that, and a whole lot more. Let's
-take a side trip to learn more about class <code>path</code> observer, composition, decomposition and query
-functions.</p>
-<h2>path_info.cpp - Path observer, composition, decomposition and query</h2>
+<p>Here is the output from <code>tut4.cpp</code>, which makes that change:</p>
+
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./tut4 ~/boost/trunk
+/home/beman/boost/trunk: is a directory containing:
+ tools
+ boost-build.jam
+ dist
+ doc
+ bootstrap.sh
+ index.html
+ bin.v2
+ bootstrap.bat
+ boost.css
+ INSTALL
+ rst.css
+ boost
+ people
+ wiki
+ boost.png
+ LICENSE_1_0.txt
+ more
+ Jamroot
+ .svn
+ libs
+ index.htm
+ status
+ CMakeLists.txt</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>C:\v3d&gt;tut4 c:\boost\trunk
+c:\boost\trunk: is a directory containing:
+ .svn
+ bin.v2
+ boost
+ boost-build.jam
+ boost.css
+ boost.png
+ bootstrap.bat
+ bootstrap.sh
+ CMakeLists.txt
+ dist
+ doc
+ index.htm
+ index.html
+ INSTALL
+ Jamroot
+ libs
+ LICENSE_1_0.txt
+ more
+ people
+ rst.css
+ status
+ tools
+ wiki</pre>
+ </td>
+ </tr>
+ </table>
+
+<h2>path_info.cpp - Path iterators, observers, composition, decomposition and query</h2>
+
+<p>The <code>path_info</code> program is handy for learning how class <code>path</code>
+iterators,
+observers, composition, decomposition, and query functions work on your system.
+If it hasn't already already been built on your system, please build it now. Run
+the examples below on your system, and try some different path arguments as we
+go along.</p>
+
+<p> <code>path_info</code> produces several dozen output lines every time it's
+invoked. We will only show the output lines we are interested in at the moment.</p>
+
+<p>First we'll look at iteration over the elements of a path, and then use
+iteration to illustrate the difference between generic and native format paths.</p>
+
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./path_info /foo/bar/baa.txt
+...
+elements:
+ /
+ foo
+ bar
+ baa.txt</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>&gt;path_info /foo/bar/baa.txt
+...
+elements:
+ /
+ foo
+ bar
+ baa.txt</pre>
+ </td>
+ </tr>
+ </table>
 
-<p>&nbsp;</p>
+<p>Thus on both POSIX and Windows based systems the path <code>&quot;/foo/bar/baa.txt&quot;</code>
+is seen as having four elements.</p>
+
+<p>Here is the code that produced the above listing:</p>
 
 <table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
   <tr>
     <td style="font-size: 10pt">
- <pre>path_info.cpp</pre>
     <blockquote style="font-size: 10pt">
- <div dir="ltr">
- <pre>const char * say_what(bool b) { return b ? &quot;true&quot; : &quot;false&quot;; }
+ <pre>cout &lt;&lt; &quot;\nelements:\n&quot;;
 
-int main(int argc, char* argv[])
-{
- if (argc &lt; 2)
- {
- std::cout &lt;&lt; &quot;Usage: path_info path-portion...\n&quot;;
- return 1;
- }
+for (path::iterator it = p.begin(); it != p.end(); ++it)
+ cout &lt;&lt; &quot; &quot; &lt;&lt; *it &lt;&lt; '\n';</pre>
+ </blockquote>
+ </td>
+ </tr>
+</table>
+<p><code>path::iterator::value_type</code> is <code>path::string_type</code>,
+and iteration treats <code>path</code> as a container of filenames.</p>
 
- fs::path p;
+<p dir="ltr">Let's look at some at the output from the a slightly different
+example:</p>
 
- for (; argc &gt; 1; --argc, ++argv)
- p /= argv[1];
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./path_info /foo/bar/baa.txt
+
+composed path:
+ cout &lt;&lt; -------------: /foo/bar/baa.txt
+ localize()-----------: /foo/bar/baa.txt
+...
+observers, native format:
+ native()---------: /foo/bar/baa.txt
+ c_str()----------: /foo/bar/baa.txt
+ native_string()--: /foo/bar/baa.txt
+ native_wstring()-: /foo/bar/baa.txt
+
+observers, generic format:
+ string()---------: /foo/bar/baa.txt
+ wstring()--------: /foo/bar/baa.txt</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>&gt;path_info /foo/bar\baa.txt
+
+composed path:
+ cout &lt;&lt; -------------: /foo/bar/baa.txt
+ localize()-----------: \foo\bar\baa.txt
+...
+observers, native format:
+ native()---------: /foo/bar\baa.txt
+ c_str()----------: /foo/bar\baa.txt
+ native_string()--: /foo/bar\baa.txt
+ native_wstring()-: /foo/bar\baa.txt
+
+observers, generic format:
+ string()---------: /foo/bar/baa.txt
+ wstring()--------: /foo/bar/baa.txt</pre>
+ </td>
+ </tr>
+ </table>
+
+<p dir="ltr"><b>Class <code>path</code> deals with two different pathname
+formats - a generic format and a native format.</b> In the case of POSIX-like
+operating systems, these formats are the same. But for users of Windows and
+other non-POSIX operating systems, the distinction is important. Even
+programmers writing for POSIX-like systems need to understand the distinction if
+they want their code to be portable to non-POSIX systems.</p>
+
+<p dir="ltr">The <b>generic format</b> is the format used by POSIX-like
+operating systems such as the Unixes, Linux, and Mac OS X. The directory
+separator character is a slash.</p>
+
+<p dir="ltr">The <b>native format</b> is the format as defined by the particular
+operating system. For Windows, either the slash or the backslash can be used as
+the directory separator character. If a drive specified or a backslash appears
+in a pathname on a Windows system, it is always treated as the native format.</p>
+
+<p dir="ltr">Native format observers should be used when interacting with the
+operating system or with users; that's what they expect.</p>
+
+<p dir="ltr">Generic format observers should be used when the results need to be
+portable and uniform regardless of the operating system.</p>
+
+<p dir="ltr"><code>path</code> objects always hold pathnames in the native
+format, but otherwise leave them unchanged from their source. The
+localize() function will convert to the
+preferred form, if the native format has several forms. Thus on Windows, it will
+convert slashes to backslashes.</p>
+
+<p dir="ltr">Let's move on to decomposition and query functions:</p>
+
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./path_info /foo/bar/baa.txt
+...
+decomposition:
+ root_name()------:
+ root_directory()-: /
+ root_path()------: /
+ relative_path()--: foo/bar/baa.txt
+ parent_path()----: /foo/bar
+ filename()-------: baa.txt
+ stem()-----------: baa
+ extension()------: .txt
+
+query:
+ empty()--------------: false
+ <span style="background-color: #FFFF00">is_absolute</span><span style="background-color: #FFFF00">()--------: true</span>
+ has_root_name()------: false
+ has_root_directory()-: true
+ has_root_path()------: true
+ has_relative_path()--: true
+ has_parent_path()----: true
+ has_filename()-------: true
+ has_stem()-----------: true
+ has_extension()------: true</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>&gt;path_info /foo/bar/baa.txt
+...
+decomposition:
+ root_name()------:
+ root_directory()-: /
+ root_path()------: /
+ relative_path()--: foo/bar/baa.txt
+ parent_path()----: /foo/bar
+ filename()-------: baa.txt
+ stem()-----------: baa
+ extension()------: .txt
+
+query:
+ empty()--------------: false
+ <span style="background-color: #FFFF00">is_absolute</span><span style="background-color: #FFFF00">()--------: false</span>
+ has_root_name()------: false
+ has_root_directory()-: true
+ has_root_path()------: true
+ has_relative_path()--: true
+ has_parent_path()----: true
+ has_filename()-------: true
+ has_stem()-----------: true
+ has_extension()------: true</pre>
+ </td>
+ </tr>
+ </table>
+
+<p dir="ltr">These are pretty self-evident, but do note the difference in the
+result of <code>is_absolute()</code> between Linux and Windows. Because there is
+no root name (i.e. drive specifier or network name), a lone slash (or backslash)
+is a relative path on Windows. </p>
+
+<p dir="ltr">On to composition!</p>
+
+<p>Class <code>path</code> uses <code>/</code> and <code>/=</code> operators to
+append elements. That's a reminder
+that these operations append the operating system's preferred directory
+separator if needed. The preferred
+directory separator is a slash on POSIX-like systems, and a backslash on
+Windows-like systems.</p>
+
+<p>path_info.cpp
+composes a path by appending each of the command line elements to an initially
+empty path:</p>
 
- std::cout &lt;&lt; &quot;\npath \&quot;&quot; &lt;&lt; p &lt;&lt; &quot;\&quot;\n&quot;;
+<table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td style="font-size: 10pt">
+ <blockquote>
+ <pre>path p; // compose a path from the command line arguments
 
- std::cout &lt;&lt; &quot;\nelements:\n&quot;;
- for (fs::path::iterator it = p.begin(); it != p.end(); ++it)
- std::cout &lt;&lt; &quot; &quot; &lt;&lt; *it &lt;&lt; '\n';
-
- std::cout &lt;&lt; &quot;\nobservers, native format:\n&quot;;
- STD_OUT &lt;&lt; &quot; native()---------: &quot; &lt;&lt; p.native() &lt;&lt; '\n';
- STD_OUT &lt;&lt; &quot; c_str()----------: &quot; &lt;&lt; p.c_str() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; native_string()--: &quot; &lt;&lt; p.native_string() &lt;&lt; std::endl;
- std::wcout &lt;&lt; &quot; native_wstring()-: &quot; &lt;&lt; p.native_wstring() &lt;&lt; std::endl;
-
- std::cout &lt;&lt; &quot;\nobservers, portable format:\n&quot;;
- std::cout &lt;&lt; &quot; string()---------: &quot; &lt;&lt; p.string() &lt;&lt; std::endl;
- std::wcout &lt;&lt; &quot; wstring()--------: &quot; &lt;&lt; p.wstring() &lt;&lt; std::endl;
-
- std::cout &lt;&lt; &quot;\ndecomposition:\n&quot;;
- std::cout &lt;&lt; &quot; root_name()------: &quot; &lt;&lt; p.root_name() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; root_directory()-: &quot; &lt;&lt; p.root_directory() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; root_path()------: &quot; &lt;&lt; p.root_path() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; relative_path()--: &quot; &lt;&lt; p.relative_path() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; parent_path()----: &quot; &lt;&lt; p.parent_path() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; filename()-------: &quot; &lt;&lt; p.filename() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; stem()-----------: &quot; &lt;&lt; p.stem() &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; extension()------: &quot; &lt;&lt; p.extension() &lt;&lt; '\n';
-
- std::cout &lt;&lt; &quot;\nquery:\n&quot;;
- std::cout &lt;&lt; &quot; empty()--------------: &quot; &lt;&lt; say_what(p.empty()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; is_complete()--------: &quot; &lt;&lt; say_what(p.is_complete()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_root_name()------: &quot; &lt;&lt; say_what(p.has_root_name()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_root_directory()-: &quot; &lt;&lt; say_what(p.has_root_directory()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_root_path()------: &quot; &lt;&lt; say_what(p.has_root_path()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_relative_path()--: &quot; &lt;&lt; say_what(p.has_relative_path()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_parent_path()----: &quot; &lt;&lt; say_what(p.has_parent_path()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_filename()-------: &quot; &lt;&lt; say_what(p.has_filename()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_stem()-----------: &quot; &lt;&lt; say_what(p.has_stem()) &lt;&lt; '\n';
- std::cout &lt;&lt; &quot; has_extension()------: &quot; &lt;&lt; say_what(p.has_extension()) &lt;&lt; '\n';
+for (; argc &gt; 1; --argc, ++argv)
+ p /= argv[1];
 
- return 0;
-}
-</pre>
- </div>
+cout &lt;&lt; &quot;\ncomposed path:\n&quot;;
+cout &lt;&lt; &quot; cout &lt;&lt; -------------: &quot; &lt;&lt; p &lt;&lt; &quot;\n&quot;;
+cout &lt;&lt; &quot; localize()-----------: &quot; &lt;&lt; p.localize() &lt;&lt; &quot;\n&quot;;</pre>
     </blockquote>
     </td>
   </tr>
 </table>
 
+<p>Let's give this code a try: </p>
+
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt">
+ <pre>$ ./path_info / foo/bar baz.txt
+
+composed path:
+ cout &lt;&lt; -------------: /foo/bar/baa.txt
+ localize()-----------: /foo/bar/baa.txt</pre>
+ </td>
+ <td style="font-size: 10pt">
+ <pre>&gt;path_info / foo/bar baa.txt
+
+composed path:
+ cout &lt;&lt; -------------: /foo/bar\baa.txt
+ localize()-----------: \foo\bar\baa.txt</pre>
+ </td>
+ </tr>
+ </table>
+
 <h3>Directory iteration tweak - tut4.cpp</h3>
 
 <table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
@@ -425,14 +729,14 @@
       cout &lt;&lt; &quot;is a directory containing:\n&quot;;
       for ( directory_iterator it (p); it != directory_iterator (); ++it )
       {
- <span style="background-color: #88FFA3">std::cout &lt;&lt; &quot; &quot; &lt;&lt; it-&gt;</span><span style="background-color: #88FFA3">path().filename</span><span style="background-color: #88FFA3">() &lt;&lt; '\n';</span>
+ <span style="background-color: #88FFA3">cout &lt;&lt; &quot; &quot; &lt;&lt; it-&gt;</span><span style="background-color: #88FFA3">path().filename</span><span style="background-color: #88FFA3">() &lt;&lt; '\n';</span>
       }
     }
     else
- std::cout &lt;&lt; &quot;exists, but is neither a regular file nor a directory\n&quot;;<span style="background-color: #88FFA3">
+ cout &lt;&lt; &quot;exists, but is neither a regular file nor a directory\n&quot;;<span style="background-color: #88FFA3">
 </span> }
   else
- std::cout &lt;&lt; &quot;does not exist\n&quot;;
+ cout &lt;&lt; &quot;does not exist\n&quot;;
 
   return 0;
 }</pre>
@@ -443,14 +747,12 @@
 
 <h3>Error handling - tut5.cpp</h3>
 
-<p>&nbsp;</p>
-
 <hr>
-<p>© Copyright Beman Dawes 2009</p>
+<p>© Copyright Beman Dawes 2009</p>
 <p>Distributed under the Boost Software License, Version 1.0. See
 <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->02 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32136" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->09 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32150" --></p>
 
 </body>
 

Modified: sandbox/filesystem-v3/libs/filesystem/doc/v3.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/v3.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/v3.html 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -50,11 +50,11 @@
 &nbsp;<ul>
     <li><code>create_symlink()</code> now supported on both POSIX and Windows.</li>
     <li><code>read_symlink()</code> function added. Supported on both POSIX and
- Windows.</li>
+ Windows. Used to read the contents of a symlink itself.</li>
     <li><code>resize_file()</code> function added. Supported on both POSIX and
- Windows.</li>
+ Windows. Used to shrink or grow a regular file.</li>
     <li><code>unique_path()</code> function added. Supported on both POSIX and
- Windows.<br>
+ Windows. Used to generate a secure temporary pathname.<br>
 &nbsp;</li>
   </ul>
   </li>
@@ -110,7 +110,7 @@
 <p>Distributed under the Boost Software License, Version 1.0. See
 <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->06 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32144" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->08 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32148" --></p>
 
 </body>
 

Modified: sandbox/filesystem-v3/libs/filesystem/example/Jamfile.v2
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/Jamfile.v2 (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/Jamfile.v2 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -3,14 +3,21 @@
 # (C) Copyright Vladimir Prus 2003
 
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or www.boost.org/LICENSE_1_0.txt)
+# See www.boost.org/LICENSE_1_0.txt
 
-# See library home page at http://www.boost.org/libs/filesystem
+# Library home page: http://www.boost.org/libs/filesystem
 
 project
- : requirements <library>../build//boost_filesystem
- <hardcode-dll-paths>true
+ : requirements
+ <library>/boost/filesystem//boost_filesystem
+ <library>/boost/system//boost_system
+ <toolset>msvc:<asynch-exceptions>on
+ <link>static
     ;
     
-exe file_size : file_size.cpp ;
-exe simple_ls : simple_ls.cpp ;
+exe tut0 : tut0.cpp ;
+exe tut1 : tut1.cpp ;
+exe tut2 : tut2.cpp ;
+exe tut3 : tut3.cpp ;
+exe tut4 : tut4.cpp ;
+exe path_info : path_info.cpp ;

Modified: sandbox/filesystem-v3/libs/filesystem/example/file_size.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/file_size.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/file_size.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -24,7 +24,7 @@
 
   std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) << '\n';
 
- fs::path p( argv[1], fs::native );
+ fs::path p( argv[1] );
 
   if ( !fs::exists( p ) )
   {

Added: sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -0,0 +1,83 @@
+// path_info.cpp ---------------------------------------------------------------------//
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+using namespace std;
+using namespace boost::filesystem;
+
+const char * say_what(bool b) { return b ? "true" : "false"; }
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2)
+ {
+ cout << "Usage: path_info path-portion...\n"
+ "Example: path_info foo/bar baz\n"
+#ifdef BOOST_POSIX_PATH
+ " would report info about the composed path foo/bar/baz\n";
+#else // BOOST_WINDOWS_PATH
+ " would report info about the composed path foo/bar\\baz\n";
+#endif
+ return 1;
+ }
+
+ path p; // compose a path from the command line arguments
+
+ for (; argc > 1; --argc, ++argv)
+ p /= argv[1];
+
+ cout << "\ncomposed path:\n";
+ cout << " cout << -------------: " << p << "\n";
+ cout << " localize()-----------: " << path(p).localize() << "\n";
+
+ cout << "\nelements:\n";
+
+ for (path::iterator it = p.begin(); it != p.end(); ++it)
+ cout << " " << *it << '\n';
+
+ cout << "\nobservers, native format:" << endl;
+#ifdef BOOST_POSIX_API
+ cout << " native()---------: " << p.native() << endl;
+ cout << " c_str()----------: " << p.c_str() << endl;
+#else // BOOST_WINDOWS_API
+ wcout << L" native()---------: " << p.native() << endl;
+ wcout << L" c_str()----------: " << p.c_str() << endl;
+#endif
+ cout << " native_string()--: " << p.native_string() << endl;
+ wcout << L" native_wstring()-: " << p.native_wstring() << endl;
+
+ cout << "\nobservers, generic format:\n";
+ cout << " string()---------: " << p.string() << endl;
+ wcout << L" wstring()--------: " << p.wstring() << endl;
+
+ cout << "\ndecomposition:\n";
+ cout << " root_name()------: " << p.root_name() << '\n';
+ cout << " root_directory()-: " << p.root_directory() << '\n';
+ cout << " root_path()------: " << p.root_path() << '\n';
+ cout << " relative_path()--: " << p.relative_path() << '\n';
+ cout << " parent_path()----: " << p.parent_path() << '\n';
+ cout << " filename()-------: " << p.filename() << '\n';
+ cout << " stem()-----------: " << p.stem() << '\n';
+ cout << " extension()------: " << p.extension() << '\n';
+
+ cout << "\nquery:\n";
+ cout << " empty()--------------: " << say_what(p.empty()) << '\n';
+ cout << " is_absolute()--------: " << say_what(p.is_absolute()) << '\n';
+ cout << " has_root_name()------: " << say_what(p.has_root_name()) << '\n';
+ cout << " has_root_directory()-: " << say_what(p.has_root_directory()) << '\n';
+ cout << " has_root_path()------: " << say_what(p.has_root_path()) << '\n';
+ cout << " has_relative_path()--: " << say_what(p.has_relative_path()) << '\n';
+ cout << " has_parent_path()----: " << say_what(p.has_parent_path()) << '\n';
+ cout << " has_filename()-------: " << say_what(p.has_filename()) << '\n';
+ cout << " has_stem()-----------: " << say_what(p.has_stem()) << '\n';
+ cout << " has_extension()------: " << say_what(p.has_extension()) << '\n';
+
+ return 0;
+}

Copied: sandbox/filesystem-v3/libs/filesystem/example/tut4.cpp (from r58642, /sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp)
==============================================================================
--- /sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/tut4.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -8,6 +8,8 @@
 // Library home page: http://www.boost.org/libs/filesystem
 
 #include <iostream>
+#include <vector>
+#include <algorithm>
 #include <boost/filesystem.hpp>
 using namespace std;
 using namespace boost::filesystem;
@@ -32,9 +34,16 @@
     else if ( is_directory(p) ) // is p a directory?
     {
       cout << "is a directory containing:\n";
- for ( directory_iterator it (p); it != directory_iterator (); ++it )
+ typedef vector<path> path_vec;
+ path_vec v;
+ for (directory_iterator it (p); it != directory_iterator(); ++it)
       {
- cout << " " << it->path().filename() << '\n';
+ v.push_back(it->path().filename());
+ }
+ sort(v.begin(), v.end());
+ for (path_vec::const_iterator it (v.begin()); it != v.end(); ++it)
+ {
+ cout << " " << *it << '\n';
       }
     }
     else

Modified: sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -216,7 +216,7 @@
   BOOST_TEST(fs::extension("a.b.c") == ".c");
   BOOST_TEST(fs::extension("a.b.c.") == ".");
   BOOST_TEST(fs::extension("") == "");
- BOOST_TEST(fs::extension("a/") == ".");
+ BOOST_TEST(fs::extension("a/") == "");
   
 // basename() tests ----------------------------------------------------------//
 

Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -168,7 +168,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\tutorial\tut0.cpp"
+ RelativePath="..\..\..\example\tut0.cpp"
>
                         </File>
                 </Filter>

Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -171,7 +171,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\tutorial\tut1.cpp"
+ RelativePath="..\..\..\example\tut1.cpp"
>
                         </File>
                 </Filter>

Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -167,7 +167,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\tutorial\tut2.cpp"
+ RelativePath="..\..\..\example\tut2.cpp"
>
                         </File>
                 </Filter>

Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -165,7 +165,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\tutorial\tut3.cpp"
+ RelativePath="..\..\..\example\tut3.cpp"
>
                         </File>
                 </Filter>

Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
@@ -167,7 +167,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\tutorial\tut4.cpp"
+ RelativePath="..\..\..\example\tut4.cpp"
>
                         </File>
                 </Filter>

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
+++ (empty file)
@@ -1,25 +0,0 @@
-// filesystem tut0.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-namespace fs = boost::filesystem;
-
-int main(int argc, char* argv[])
-{
- if (argc < 2)
- {
- std::cout << "Usage: tut0 path\n";
- return 1;
- }
-
- std::cout << argv[1] << '\n';
-
- return 0;
-}

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
+++ (empty file)
@@ -1,26 +0,0 @@
-// filesystem tut1.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-using namespace std;
-using namespace boost::filesystem;
-
-int main(int argc, char* argv[])
-{
- if (argc < 2)
- {
- cout << "Usage: tut1 path\n";
- return 1;
- }
-
- cout << argv[1] << ": " << file_size(argv[1]) << '\n';
-
- return 0;
-}

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut1_crash.jpg
==============================================================================
Binary file. No diff available.

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
+++ (empty file)
@@ -1,42 +0,0 @@
-// filesystem tut2.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-using namespace std;
-using namespace boost::filesystem;
-
-int main(int argc, char* argv[])
-{
- if (argc < 2)
- {
- cout << "Usage: tut2 path\n";
- return 1;
- }
-
- path p (argv[1]); // p reads clearer than argv[1] in the following code
-
- cout << p << ": "; // utilize the path narrow stream inserter
-
- if ( exists(p) ) // does p actually exist?
- {
- if ( is_regular_file(p) ) // is p a regular file?
- cout << file_size(p) << '\n';
-
- else if ( is_directory(p) ) // is p a directory?
- cout << "is a directory\n";
-
- else
- cout << "exists, but is neither a regular file nor a directory\n";
- }
- else
- cout << "does not exist\n";
-
- return 0;
-}

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
+++ (empty file)
@@ -1,54 +0,0 @@
-// filesystem tut3.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-using namespace std;
-using namespace boost::filesystem;
-
-int main(int argc, char* argv[])
-{
- if (argc < 2)
- {
- cout << "Usage: tut3 path\n";
- return 1;
- }
-
- path p (argv[1]); // p reads clearer than argv[1] in the following code
-
- cout << p << ": "; // utilize the path narrow stream inserter
-
- if ( exists(p) ) // does p actually exist?
- {
- if ( is_regular_file(p) ) // is p a regular file?
- cout << file_size(p) << '\n';
-
- else if ( is_directory(p) ) // is p a directory?
- {
- cout << "is a directory containing:\n";
-
- for ( directory_iterator it (p); // initialize it to the first element
- it != directory_iterator(); // test for the past-the-end element
- ++it ) // increment
- {
- cout << " " << *it << '\n'; // *it returns a directory_entry,
- // which is converted to a path
- // by the stream inserter.
- // it->path() would be wordier, but would
- // eliminate an unnecessary path temporary
- }
- }
- else
- cout << "exists, but is neither a regular file nor a directory\n";
- }
- else
- cout << "does not exist\n";
-
- return 0;
-}

Deleted: sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp 2010-01-10 16:12:38 EST (Sun, 10 Jan 2010)
+++ (empty file)
@@ -1,47 +0,0 @@
-// filesystem tut4.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#include <iostream>
-#include <boost/filesystem.hpp>
-using namespace std;
-using namespace boost::filesystem;
-
-int main(int argc, char* argv[])
-{
- if (argc < 2)
- {
- cout << "Usage: tut4 path\n";
- return 1;
- }
-
- path p (argv[1]); // p reads better than argv[1] in following code
-
- cout << p << ": "; // utilize the path stream inserter
-
- if ( exists(p) ) // does p actually exist?
- {
- if ( is_regular_file(p) ) // is p a regular file?
- cout << file_size(p) << '\n';
-
- else if ( is_directory(p) ) // is p a directory?
- {
- cout << "is a directory containing:\n";
- for ( directory_iterator it (p); it != directory_iterator (); ++it )
- {
- cout << " " << it->path().filename() << '\n';
- }
- }
- else
- cout << "exists, but is neither a regular file nor a directory\n";
- }
- else
- cout << "does not exist\n";
-
- return 0;
-}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk