[BACK]Return to conv.pm CVS log [TXT][DIR] Up to [local] / wpscripts / epickup

File: [local] / wpscripts / epickup / conv.pm (download)

Revision 1.1, Fri Jun 3 09:28:47 2011 UTC (12 years, 9 months ago) by yason
Branch point for: MAIN

Initial revision

#!/usr/bin/perl

package conv;

sub to_local($)
{
    my $path = shift;
    my $searchpath;

    # dirty hack to escape database' strange behaviors
    if ($path eq '') { return(0); }

    # truncate spaces
    while( index($path, ' ', 0) != -1 )
    {
	chop($path);
    }

    $searchpath = substr($path, 23);

    # make local file path
    $searchpath =~ tr/\\/\//; $searchpath = '/WIDEPRINT/' . $searchpath;

    return($searchpath);
}


sub basename($)
{
    # extract file name
    my $path = shift;

    my $path = `basename $path`;
    chomp($path);

    return($path);
}
	

sub dirname($)
{
    # extract file directory
    my $path = shift;

    my $path = `dirname $path`;
    chomp($path);

    return($path);
}

return(1);