Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
I usually have to copy a group of files to one or more USB drive. It quite difficult to send the files to the USB drives in the most effective and efficient way so that from a group of files, the ones that fit with the least amount of free space remaining get copied to the USB drive.

**I'm not a programming student, I just like programming and have some experience with BASIC language.

What I have tried:

I have done some research on this but couldn't find anything useful.
I will continue looking for information, and if i find something then i will insert it here.
Posted
Updated 19-Feb-17 20:42pm
Comments
Garth J Lancaster 19-Feb-17 20:45pm    
I'm not sure what you searched for, but first fit/next fit/best fit algorithms spring to mind, closely followed by constraints based algorithms for 'box packing'
CPallini 20-Feb-17 3:23am    
Why do you need C++ for such a task? You could stick with VB, in my opinion.

1 solution

My short research for "get free disk space windows c++" with Google gave me the GetDiskFreeSpace function with returns the amount of free space.

That should be the starting point of calculating the optimal file set for your copy job.

And guess: to copy a file you can use CopyFile.

Consider learning the powerful C++ language and the Windows API. ;-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900