VMS::FileUtils::SafeName -- convert special chars and case of filenames
use VMS::FileUtils::SafeName qw(:all) ;
$vmsusablename = safename('unix:..name &tc',$do_all_dots); $unixname = unsafename($vmsusablename); $path = safepath('x.y/version:1.2.3',$do_all_dots_filename); $unixpath = unsafepath($safepathoutput); $archivename = safe_archive('HTML-Parser-1.07.tar.gz');
This package provides conversion between Unix filenames and VMS filenames where the Unix filenames may have characters that are illegal under VMS.
Spaces, punctuation, control characters, etc. get mapped to a sequence of the form '$6C'. Also the case of the original unix filename is preserved using '$' to shift from lower to uppercase:
Unix filename safename output ------------- --------------- abc.DEF.ghi -> $ABC.$DEF$5NGHI ^ ^ ^^^ extra periods get converted +----+-------change case
The conversion may be reversed with unsafename
The conversion provided here is the same as is contained in the Multinet and UCX NFS software.
Routines:
Converts upper/lower case, punctuation etc. to chars valid for VMS filename. The first '.' in the filename is left intact (unless the second parameter to vmsify_name is true, in which case all .s are converted).
Lowercase is taken as the default for input filenames.
Converts filenames produced by safename back to their original form.
Converts path elements into VMS-safe form. The trailing element (if the path doesn't end in a '/') can optionally have all periods converted, or (default) all but the first period converted. Path elements that correspond to directory names have all periods converted
Reverses the conversion done by safepath
Converts filename of the type typically used for CPAN archives into a VMS-compatible format:
HTML-Parser-1.07.tar.gz -> HTML-Parser-1_07.tar-gz
This document was last revised on 10 Mar 1998, for Perl 5.004.59
To install VMS::FileUtils::Root, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VMS::FileUtils::Root
CPAN shell
perl -MCPAN -e shell install VMS::FileUtils::Root
For more information on module installation, please visit the detailed CPAN module installation guide.