static function MoveFile($from_file,$to_file,&$error = null,&$error_str = null){
		$error = false;
		$error_str = "";

		settype($from_file,"string");
		settype($to_file,"string");

		if(is_dir($to_file) && file_exists($from_file) && !is_dir($from_file)){
			// copying a file to an existing directory
			preg_match('/([^\/]+)$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
			
		}elseif(is_dir($to_file) && file_exists($from_file) && is_dir($from_file)){
			// copying a directory to an existing directory
			preg_match('/([^\/]+)\/*$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
		}

		if($from_file==$to_file){
			$error = true;
			$error_str = "from_file and to_file are the same files";
			return 0;
		}

		$_stat = rename($from_file,$to_file);
		if(!$_stat){
			$error = true;
			$error_str = "can't rename $from_file to $to_file";
			return 0;
		}	

		return 1;
	}