Index: trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
===================================================================
--- trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 15852)
+++ trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 16207)
@@ -1,5 +1,5 @@
 # Copyright (c) 2006  Paul Price, Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.72 2007-12-16 22:14:18 eugene Exp $
+# $Id: Config.pm,v 1.73 2008-01-23 23:33:25 eugene Exp $
 
 package PS::IPP::Config;
@@ -462,4 +462,27 @@
 }
 
+# Prepare to receive a new file --- create the directory, if appropriate.  Return the appropriate filename
+# Does not register anything with Nebulous
+sub outroot_prepare
+{
+    my $self = shift;		# Configuration object
+    my $outroot = shift;	# Working directory
+
+    # outroot is a directory + fragement of a filename
+
+    my $scheme = file_scheme($outroot); # The scheme, e.g., file://, path://
+    return 1 if defined $scheme and lc($scheme) eq 'neb'; # Nothing to be done: Nebulous handles it all
+
+    # Might need to create a directory
+    # not guaranteed to have a scheme (path:// or file://) - might be /PATH/foobar
+    # a relative path (PATH/foobar) is invalid here
+    my $resolved = $self->convert_filename_absolute( $outroot );
+    my ( $vol, $dirs, $file ) = File::Spec->splitpath( $resolved );
+    unless (-d $dirs) {
+	system("mkdir -p $dirs") == 0 or (carp "Can't create directory $dirs" and exit($PS_EXIT_DATA_ERROR));
+    }
+
+    return 1;
+}
 
 # Convert a relative filename (e.g., "path://PATH/file") to an absolute (e.g., "/path/to/file")
