visual studio 2012 - Bulk copying files in C++ Windows 8 Store app -
i have windows 8 store app written using c++/cx in need copy multiple files (in 1 shot) user-selected location app's localdata folder.
in windows runtime, find storagefile::copyasync api allows me copy 1 file @ time. way:
task<ivectorview<storagefile^>^>(openpicker->pickmultiplefilesasync()).then([this](ivectorview<storagefile^>^ filevector) { m_copytasks.clear(); (auto file : filevector) { m_copytasks.push_back(create_task(file->copyasync(applicationdata::current->temporaryfolder, file->name, namecollisionoption::replaceexisting))); } when_all(begin(m_copytasks), end(m_copytasks)).then([this](std::vector<storagefile^> results) { (auto copiedfile : results) { // stuff } }).then([this]() { // stuff }); });
is there better alternative doesn't force me create separate task every file bur rather allows me copy user-selected filevector in 1 go?
Comments
Post a Comment