mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 17:04:58 -04:00
added an option to follow symbolic links or not, and anti-loop system during directories traversal
This commit is contained in:
parent
cf270d73c0
commit
5f69c9ea1f
13 changed files with 218 additions and 126 deletions
|
@ -480,6 +480,21 @@ bool RsDirUtil::checkCreateDirectory(const std::string& dir)
|
|||
}
|
||||
|
||||
|
||||
std::string RsDirUtil::removeSymLinks(const std::string& path)
|
||||
{
|
||||
#warning (Mr.Alice): I don't know how to do this on windows. See https://msdn.microsoft.com/en-us/library/windows/desktop/hh707084(v=vs.85).aspx
|
||||
#ifdef WINDOWS_SYS
|
||||
//if(!S_OK == PathCchCanonicalizeEx(tmp,...) ;
|
||||
return path ;
|
||||
#else
|
||||
char *tmp = canonicalize_file_name(path.c_str()) ;
|
||||
std::string result(tmp) ;
|
||||
|
||||
free(tmp);
|
||||
return result ;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsDirUtil::cleanupDirectory(const std::string& cleandir, const std::set<std::string> &keepFiles)
|
||||
{
|
||||
for(librs::util::FolderIterator it(cleandir,false);it.isValid();it.next())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue