$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r72309 - trunk/libs/filesystem/v3/example
From: bdawes_at_[hidden]
Date: 2011-05-31 11:14:28
Author: bemandawes
Date: 2011-05-31 11:14:26 EDT (Tue, 31 May 2011)
New Revision: 72309
URL: http://svn.boost.org/trac/boost/changeset/72309
Log:
Add exists(path) information
Text files modified: 
   trunk/libs/filesystem/v3/example/file_status.cpp |    16 ++++++++++++++++                        
   1 files changed, 16 insertions(+), 0 deletions(-)
Modified: trunk/libs/filesystem/v3/example/file_status.cpp
==============================================================================
--- trunk/libs/filesystem/v3/example/file_status.cpp	(original)
+++ trunk/libs/filesystem/v3/example/file_status.cpp	2011-05-31 11:14:26 EDT (Tue, 31 May 2011)
@@ -74,6 +74,20 @@
     cout << "is_symlink(s) is " << (is_symlink(s) ? "true" : "false") << "\n";
   }
 
+  void try_exists()
+  {
+    cout << "\nexists(" << p << ") ";
+    try
+    {
+      bool result = exists(p);
+      cout << "is " << (result ? "true" : "false") << "\n";
+    }
+    catch (const filesystem_error& ex)
+    {
+      cout << "throws a filesystem_error exception: " << ex.what() << "\n";
+    }
+  }
+
 }
 
 int cpp_main(int argc, char* argv[])
@@ -97,5 +111,7 @@
   cout << "\nfile_status s = symlink_status(" << p << ", ec) ";
   show_status(s, ec);
 
+  try_exists();
+
   return 0;
 }