Change 14975 by ams@lustre on 2002/03/04 02:01:27

           Subject: [PATCH] File::Path documentation
           From: Colin Meyer <[EMAIL PROTECTED]>
           Date: Sun, 3 Mar 2002 14:54:24 -0800
           Message-Id: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/lib/File/Path.pm#30 edit

Differences ...

==== //depot/perl/lib/File/Path.pm#30 (text) ====
Index: perl/lib/File/Path.pm
--- perl/lib/File/Path.pm.~1~   Sun Mar  3 19:15:05 2002
+++ perl/lib/File/Path.pm       Sun Mar  3 19:15:05 2002
@@ -40,6 +40,15 @@
 It returns a list of all directories (including intermediates, determined
 using the Unix '/' separator) created.
 
+If a system error prevents a directory from being created, then the
+C<mkpath> function throws a fatal error with Perl's C<croak> mechanism.
+This error can be trapped with an C<eval> block:
+
+  eval { mkpath($dir) };
+  if ($@) {
+    print "Couldn't create $dir: $@";
+  }
+
 Similarly, the C<rmtree> function provides a convenient way to delete a
 subtree from the directory structure, much like the Unix command C<rm -r>.
 C<rmtree> takes three arguments:
End of Patch.

Reply via email to