Changeset 16207 for trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
- Timestamp:
- Jan 23, 2008, 1:33:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
r15852 r16207 1 1 # Copyright (c) 2006 Paul Price, Joshua Hoblitt 2 2 # 3 # $Id: Config.pm,v 1.7 2 2007-12-16 22:14:18eugene Exp $3 # $Id: Config.pm,v 1.73 2008-01-23 23:33:25 eugene Exp $ 4 4 5 5 package PS::IPP::Config; … … 462 462 } 463 463 464 # Prepare to receive a new file --- create the directory, if appropriate. Return the appropriate filename 465 # Does not register anything with Nebulous 466 sub outroot_prepare 467 { 468 my $self = shift; # Configuration object 469 my $outroot = shift; # Working directory 470 471 # outroot is a directory + fragement of a filename 472 473 my $scheme = file_scheme($outroot); # The scheme, e.g., file://, path:// 474 return 1 if defined $scheme and lc($scheme) eq 'neb'; # Nothing to be done: Nebulous handles it all 475 476 # Might need to create a directory 477 # not guaranteed to have a scheme (path:// or file://) - might be /PATH/foobar 478 # a relative path (PATH/foobar) is invalid here 479 my $resolved = $self->convert_filename_absolute( $outroot ); 480 my ( $vol, $dirs, $file ) = File::Spec->splitpath( $resolved ); 481 unless (-d $dirs) { 482 system("mkdir -p $dirs") == 0 or (carp "Can't create directory $dirs" and exit($PS_EXIT_DATA_ERROR)); 483 } 484 485 return 1; 486 } 464 487 465 488 # Convert a relative filename (e.g., "path://PATH/file") to an absolute (e.g., "/path/to/file")
Note:
See TracChangeset
for help on using the changeset viewer.
