jMultiFilesAndDirsCopy is a lightweight, specialized utility designed for the batch copying and moving of files and directories across a Windows environment.
While the software itself is primarily distributed as a graphical user interface (GUI) application to bypass the rigid limitations of standard Windows Explorer file transfers, its core execution engine relies on a modular programmatic framework. Core Architecture & API Blueprint
The library is engineered as a multi-threaded execution queue. It processes batch I/O operations asynchronously to prevent interface locking, utilizing low-level Win32 API overrides for maximized throughput. Primary Data Structure
{ “source_paths”: [“C:\Data\ProjectA”, “D:\Backups\Logs\app.log”], “destination_paths”: [“E:\Archive\2026\”, “F:\CloudSync\Remote\”], “options”: { “overwrite_policy”: “skip_existing | overwrite_newer | force_all”, “preserve_timestamps”: true, “create_missing_directories”: true, “max_concurrent_threads”: 4 } } Use code with caution. API Reference 1. Core Execution Engine jCopyEngine.InitializeCopy(SourceList, TargetList, Options)
Purpose: Registers the payload array and instantiates the multi-threaded queue.
Parameters: Accepts an array of absolute path strings for both source and target matrices. Returns: A unique transaction SessionID (string). jCopyEngine.ExecuteAsync(SessionID)
Purpose: Starts the non-blocking worker threads to execute the transfer queue. jCopyEngine.CancelTransaction(SessionID)
Purpose: Gracefully halts the execution loop, releases file handles, and ensures no half-written (corrupted) target files remain. 2. Event Listeners & Callbacks
OnProgressChanged(BytesTransferred, TotalBytes, CurrentFile)
Fires iteratively to provide localized real-time tracking percentages. OnTransferError(SourcePath, ErrorCode, ExceptionMessage)
Triggers during permission errors, file-in-use locks, or path-too-long limits, passing the event to the error handling routine rather than crashing the thread pool. Implementation Guide
To implement the jMultiFilesAndDirsCopy transfer logic in custom automation scripts or custom builds, follow this sequential structural blueprint. Step 1: Initialize the Payload Arrays
Construct your target and source matrices. The engine matches array indices for explicit transfers or maps multiple items to a single directory when targeting a folder array. Step 2: Configure the Overwrite & Safety Flags
Define how the engine responds when a file collision occurs. It is critical to enforce explicit overwrite_policy conditions to prevent accidental data erasure over slow network paths or local volumes. Step 3: Instantiate and Execute Async Loop
Invoke the asynchronous copy routine. Ensure you bind the event listeners to catch disk-space limits or system I/O errors immediately.
// Conceptual Implementation Example var copySession = new jCopyEngine(); var batchPayload = new TransferPayload { SourcePaths = new string[] { @“C:\SourceFolder\” }, DestinationPaths = new string[] { @“E:\DestinationBackup\” }, OverwritePolicy = Policies.OverwriteNewer }; string sessionId = copySession.InitializeCopy(batchPayload); copySession.OnProgressChanged += (bytes, total, file) => { Console.WriteLine($“Progress: {(bytes100 / total)}% | Copying: {file}”); }; // Fire the non-blocking execution thread copySession.ExecuteAsync(sessionId); Use code with caution. Key Operational Features
Visual Split-Pane Mapping: The underlying engine powers a distinct dual-panel interface mapping source directories on the left directly to destination arrays on the right.
Network & Cloud Resiliency: The file stream controller features automated retry delays to withstand brief network dropouts or intermittent connection loss during cloud-mapped storage migrations.
Deep Path Traversal: Bypasses standard Explorer path limitations by parsing directory trees down past the typical MAX_PATH boundaries via long-path syntax handling (\?</code>).
Leave a Reply