Board index » cppbuilder » Re: Copying one file into another
CJ
![]() CBuilder Developer |
CJ
![]() CBuilder Developer |
Re: Copying one file into another2007-11-08 08:11:37 AM cppbuilder103 Quote>__fastcall ~TCopyThread(); |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-11-08 08:17:49 AM
Re:Re: Copying one file into another
"CJ" < XXXX@XXXXX.COM >wrote in message
QuoteI don't think this code likes me, just when I though I had it all Execute() and DoTerminate() instead. Remove the destructor from the class declaration. QuoteI don't see why there is an error. Gambit |
CJ
![]() CBuilder Developer |
2007-11-08 09:44:59 AM
Re:Re: Copying one file into another
Gambit, can you explain something to me in a nutshell.
I tried copying a 50MB file and it only copied 1MB, I am looking at the code and trying to understand it. From what I see, the code is taking one file and copying 1MB of the contents to another file. Is that correct? CJ {smallsort} |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-11-08 12:18:11 PM
Re:Re: Copying one file into another
"CJ" < XXXX@XXXXX.COM >wrote in message
QuoteI tried copying a 50MB file and it only copied 1MB QuoteI am looking at the code and trying to understand it. From Gambit |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-11-08 12:50:47 PM
Re:Re: Copying one file into another
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
QuoteIt is supposed to be copying the entire file in 1MB chunks, 1 chunk per one thread at a time can successfully open the file for writing. Change this line: hDestFile = CreateFile(FDestFile.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); To this instead: hDestFile = CreateFile(FDestFile.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); Gambit |
CJ
![]() CBuilder Developer |
2007-11-08 10:21:06 PM
Re:Re: Copying one file into anotherQuoteTo this instead: the internals of this stuff. Thanks for all of your help CJ |