Home > Software engineering >  When copying files used by CopyFile or MoveFile why one-time only copy 164 files?
When copying files used by CopyFile or MoveFile why one-time only copy 164 files?

Time:10-05

As title, I need to batch rename files, reoccupy used by CopyFile or MoveFile copy, copy a maximum of 165 files, what's the problem? Or is there any way to solve?
 MoveFile (sInitCompleteName sNewPathAndName); 
Used by CopyFile (sInitCompleteName sNewPathAndName);

CodePudding user response:

SInitCompleteName, sNewPathAndName is how to?

CodePudding user response:

reference 1st floor zgl7903 response:
sInitCompleteName, sNewPathAndName is how to?

This is my own definition, sInitCompleteName on behalf of the original file path, sNewPathAndName copy the new file path

CodePudding user response:

In the real world, in addition to the time and space could be infinite, any other things are limited,

When copying files used by CopyFile or MoveFile why one-time only copy 1000000 files?

CodePudding user response:

reference zhao4zhong1 reply: 3/f
in the real world, in addition to the time and space could be infinite, any other things are limited,

When copying files used by CopyFile or MoveFile why one-time only copy 1000000 files?


Miss zhao said yes!!!!! Because of the large to the batch file, so when it is used in used by copyfile one-time can only copy this 164, I don't know what is the principle? Didn't search all the time, also hope to have what solutions can one-time more copies of the documents

CodePudding user response:

Internal implementation can debug tracking this API (need to know some assembly)
See how the internal implementation

CodePudding user response:

reference 4 floor maoxige response:
Quote: reference zhao4zhong1 reply: 3/f

In the real world, in addition to the time and space could be infinite, any other things are limited,

When copying files used by CopyFile or MoveFile why one-time only copy 1000000 files?


Miss zhao said yes!!!!! Because of the large to the batch file, so when it is used in used by copyfile one-time can only copy this 164, I don't know what is the principle? Didn't search all the time, also hope to have what solutions can one-time more copies of the file

His judgement, more than 100, operating for many times,

CodePudding user response:

So weird? I tried no problem!

: : MoveFile (" v: \ \ TEMP ", "v: \ \ TEMP2");
I have 1000 files under the TEMP




Can you post your code?

CodePudding user response:

refer to 7th floor simoreg response:
so weird? I tried no problem!

: : MoveFile (" v: \ \ TEMP ", "v: \ \ TEMP2");
I have 1000 files under the TEMP




Can you post your code?

Do you dare to try 1000000 files? !

CodePudding user response:

With the SHFileOperation

CodePudding user response:

Actually myself for batch copy is written in your API instead of, after all, the system API or too simple, too complicated, used by CopyFile parameters are too simple, too, for example, a file at a time, and SHFileOperation and too much trouble, path parameters are required to double zero at the end, if you want a layer of packaging, means to copy a inside, to allocate a zero, and special treatment,

CodePudding user response:

Search "robocopy"
  • Related