'url_query_encode', 'url_query_decode',
'split_url', 'join_url', 'merge_url',
'html_entity_encode_dec', 'html_entity_encode_hex', 'html_entity_encode_name', 'html_entity_decode',
- 'join_path', 'make_temp_path',
+ 'join_path', 'dir_path', 'make_temp_path',
'system_encoded', 'exec_encoded'
);
return $path;
}
+sub dir_path {
+ (my $joiner, my $path) = @_;
+ my $ind = rindex($path, $joiner);
+ if ($ind < 0) {
+ return ('', $path);
+ }
+ elsif ($ind == 0) {
+ return (
+ $joiner,
+ substr($path, $ind+length($joiner))
+ );
+ }
+ else {
+ return (
+ substr($path, 0, $ind),
+ substr($path, $ind+length($joiner))
+ );
+ }
+}
+
sub make_temp_path {
(my $dir, my $basename) = @_;