| 304 | |
| 305 | |
| 306 | int stdWorkAsync( _In_ std::wstring arg, _In_ const bool isLargeFetch, _In_ const bool isBasicInfo, const bool DoPrintTree = false ) { |
| 307 | std::wcout << L"Working on: `" << arg << L"`" << std::endl; |
| 308 | std::int64_t numberFiles = 0; |
| 309 | arg.reserve( MAX_PATH ); |
| 310 | WIN32_FIND_DATA fData; |
| 311 | |
| 312 | if ( arg.length( ) > 3 ) { |
| 313 | auto strCmp = ( arg.compare( 0, 4, arg, 0, 4 ) ); |
| 314 | if ( strCmp != 0 ) { |
| 315 | arg = L"\\\\?\\" + arg; |
| 316 | std::wcout << L"prefixed `" << arg << L"`, value now: `" << arg << L"`" << std::endl << std::endl; |
| 317 | } |
| 318 | } |
| 319 | else { |
| 320 | arg = L"\\\\?\\" + arg; |
| 321 | std::wcout << L"prefixed `" << arg << L"`, value now: `" << arg << L"`" << std::endl << std::endl; |
| 322 | } |
| 323 | HANDLE fDataHand = FindFirstFile( arg.c_str( ), &fData ); |
| 324 | auto m_rootFile = std::make_unique < File >( ) ; |
| 325 | m_rootFile->m_done = false; |
| 326 | m_rootFile->m_files = 0; |
| 327 | m_rootFile->m_isRootItem = true; |
| 328 | m_rootFile->m_parent = nullptr; |
| 329 | m_rootFile->m_readJobDone = false; |
| 330 | m_rootFile->m_readJobs = 1; |
| 331 | m_rootFile->m_subdirs = 0; |
| 332 | m_rootFile->m_rootPath = arg; |
| 333 | m_rootFile->m_FileInfo.attributes = fData.dwFileAttributes; |
| 334 | m_rootFile->m_FileInfo.lastWriteTime = fData.ftLastWriteTime; |
| 335 | m_rootFile->m_FileInfo.name = fData.cFileName; |
| 336 | m_rootFile->m_FileInfo.m_size = ( std::uint64_t( fData.nFileSizeHigh ) * ( std::uint64_t( MAXDWORD )+ 1 ) ) + std::uint64_t( fData.nFileSizeLow ); |
| 337 | if ( fData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { |
| 338 | m_rootFile->m_type = IT_DIRECTORY; |
| 339 | } |
| 340 | else { |
| 341 | std::wcerr << L"FATAL! " << arg << L" is not a directory!" << std::endl; |
| 342 | return 666; |
| 343 | } |
| 344 | |
| 345 | numberFiles = stdRecurseFindFutures( arg, isLargeFetch, isBasicInfo, m_rootFile.get( ) ); |
| 346 | std::wcout << std::endl << L"Number of items: " << numberFiles << std::endl; |
| 347 | //std::wcout << L"Total size of children: " << sumChildren( m_rootFile.get( ) ) << std::endl; |
| 348 | std::wcout << L"->" << m_rootFile->UpwardGetPathWithoutBackslash( ) << std::endl; |
| 349 | if ( DoPrintTree ) { |
| 350 | printTree( m_rootFile.get( ) ); |
| 351 | } |
| 352 | return 0; |
| 353 | } |
| 354 | |
| 355 | |
| 356 | const DOUBLE getAdjustedTimingFrequency( ) { |
no test coverage detected