Author: spadkins
Date: Tue May 2 06:13:00 2006
New Revision: 5999
Modified:
p5ee/trunk/App-Context/lib/App.pm
Log:
added OS-independent mkdir() method (uses File::Spec)
Modified: p5ee/trunk/App-Context/lib/App.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App.pm (original)
+++ p5ee/trunk/App-Context/lib/App.pm Tue May 2 06:13:00 2006
@@ -382,7 +382,7 @@
my (%used);
-sub use ($) {
+sub use {
&App::sub_entry if ($App::trace);
my ($self, $class) = @_;
if (! defined $used{$class}) {
@@ -405,6 +405,23 @@
&App::sub_exit() if ($App::trace);
}
+# $dir = App->mkdir($prefix, "data", "app", "Context");
+sub mkdir {
+ &App::sub_entry if ($App::trace);
+ my ($self, @dirs) = @_;
+
+ my $dir = shift(@dirs);
+ if ($dir) {
+ mkdir($dir) if (! -d $dir);
+ foreach my $d (@dirs) {
+ $dir = File::Spec->catdir($dir, $d);
+ mkdir($dir) if (! -d $dir);
+ }
+ }
+ &App::sub_exit($dir) if ($App::trace);
+ return($dir);
+}
+
#############################################################################
# printargs()
#############################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.