public static function remove_relative_path($path) {
        $pieces = explode('/', $path);
        $new_pieces = array();
        for($i=0; $i < count($pieces); $i++) {
            if ($pieces[$i] == '.' ) continue;
            if ($pieces[$i] == '..' ) {
                array_pop($new_pieces);
                continue;
            }
            $new_pieces[] = $pieces[$i];
        }
        $retval = implode("/",$new_pieces);
        return $retval;
    }