static int snprint_multipath_vpr (char * buff, size_t len, struct multipath * mpp) { struct path * pp = first_path(mpp); if (!pp) return 0; return snprintf(buff, len, "%s,%s", pp->vendor_id, pp->product_id); }
/************************************rename***************************************** 调用move,只要from_path和to_path只有文件名不一样时,就可以将from_path中的文件名改为to_path中的文件名 */ void kp_api::rename(string path,string new_name) { string first_path(path); int i = path.rfind("/"); if(i==-1) path = new_name; else { int len = path.length() - i; //cout<<i<<"**"<<len<<endl; path.replace(i+1,len,new_name); } //cout<<path<<endl; kp_api::move(first_path,path); }