mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
Added Function to move an 'extraFile' to another location.
This will be used to retrieve channel files. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@844 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d56d3e57f9
commit
f5fa2f9a68
5 changed files with 39 additions and 0 deletions
|
@ -197,6 +197,30 @@ bool ftExtraList::removeExtraFile(std::string hash, uint32_t flags)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ftExtraList::moveExtraFile(std::string fname, std::string hash, uint64_t size,
|
||||
std::string destpath)
|
||||
{
|
||||
RsStackMutex stack(extMutex);
|
||||
|
||||
std::map<std::string, FileDetails>::iterator it;
|
||||
it = mFiles.find(hash);
|
||||
if (it == mFiles.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string path = destpath + '/' + fname;
|
||||
if (0 == rename(it->second.info.path.c_str(), path.c_str()))
|
||||
{
|
||||
/* rename */
|
||||
it->second.info.path = path;
|
||||
it->second.info.fname = fname;
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool ftExtraList::cleanupOldFiles()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue