dimanche 19 mai 2019

how to copy particular folder to another directory?

How can i move only one folder with its sub-content from list of folders to another directory using fileSystem in C++11?

I have tried filsSystem fs::copy copyrecursive or rename options, But either it copies or moves all folder or it copies only sub-folder ( except main directory which also should have been moved)

fs::copy(p,path->dirPath,fs::copy_options::overwrite_existing | fs::copy_options::recursive | fs::copy_options::copy_symlinks )

 recursive_copy(dirPath.c_str(),path->dirPath.c_str(),ec);

for Ex : I have ./test as parent directory. under parent I have three folders.

/f1 /f2 /f3

under /f2 I have two softlink in two files

/softlink.lno text1 text2

I want to move f2 folder and its subcontent to f1 .But with what I tried, it is only coping either subcontent of f2 directory or all folders f1,f2,f2 to f1.

Aucun commentaire:

Enregistrer un commentaire