home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / RPC / !Perl / lib / zip / auto / DynaLoader / dl_expandspec.al < prev    next >
Encoding:
Text File  |  1999-04-05  |  1.7 KB  |  43 lines

  1. # NOTE: Derived from ../../lib/DynaLoader.pm.
  2. # Changes made here will be lost when autosplit again.
  3. # See AutoSplit.pm.
  4. package DynaLoader;
  5.  
  6. #line 288 "../../lib/DynaLoader.pm (autosplit into ../../lib/auto/DynaLoader/dl_expandspec.al)"
  7. sub dl_expandspec {
  8.     my($spec) = @_;
  9.     # Optional function invoked if DynaLoader.pm sets $do_expand.
  10.     # Most systems do not require or use this function.
  11.     # Some systems may implement it in the dl_*.xs file in which case
  12.     # this autoload version will not be called but is harmless.
  13.  
  14.     # This function is designed to deal with systems which treat some
  15.     # 'filenames' in a special way. For example VMS 'Logical Names'
  16.     # (something like unix environment variables - but different).
  17.     # This function should recognise such names and expand them into
  18.     # full file paths.
  19.     # Must return undef if $spec is invalid or file does not exist.
  20.  
  21.     my $file = $spec; # default output to input
  22.  
  23.     if ($Is_VMS) { # dl_expandspec should be defined in dl_vms.xs
  24.     require Carp;
  25.     Carp::croak("dl_expandspec: should be defined in XS file!\n");
  26.     } elsif ($Is_RISCOS) {
  27.     # filename, input conversion, output conversion
  28.     # input conversion uses the "interal" flag setting to go to RISC OS
  29.     # canonicalise then converts logical paths to physical
  30.     # output conversion is turned off
  31.     # result is fully qualified native pathname, which UnixLib's
  32.     # fopen() and stat() will recognises and hence not "riscosify"
  33.     $file = RISCOS::Filespec::canonicalise ($file, &RISCOS::Filespec::convert_internal, RISCOS::Filespec::constant('__RISCOSIFY_NO_PROCESS'));
  34.     } else {
  35.     return undef unless -f $file;
  36.     }
  37.     print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug;
  38.     $file;
  39. }
  40.  
  41. # end of DynaLoader::dl_expandspec
  42. 1;
  43.