Click here to Skip to main content
15,850,753 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: download a web page Pin
Mircea Neacsu6-Dec-23 6:00
Mircea Neacsu6-Dec-23 6:00 
GeneralRe: download a web page Pin
mike74116-Dec-23 14:28
mike74116-Dec-23 14:28 
GeneralRe: download a web page Pin
Mircea Neacsu6-Dec-23 15:18
Mircea Neacsu6-Dec-23 15:18 
AnswerRe: download a web page Pin
jschell6-Dec-23 7:52
jschell6-Dec-23 7:52 
AnswerRe: download a web page Pin
Gerry Schmitz6-Dec-23 8:28
mveGerry Schmitz6-Dec-23 8:28 
Questioncopying a file in C++17 Pin
mike74115-Dec-23 22:36
mike74115-Dec-23 22:36 
AnswerRe: copying a file in C++17 Pin
Richard MacCutchan5-Dec-23 23:07
mveRichard MacCutchan5-Dec-23 23:07 
AnswerRe: copying a file in C++17 Pin
jschell6-Dec-23 8:04
jschell6-Dec-23 8:04 
mike7411 wrote:
Is this a good way of doing it?


1. You want to check what happens if different drives are involved.
2. You want to verify paths are supported.
3. Catching one type of exception ignores possible other ones. Probably unlikely but in case.


mike7411 wrote:
buffer sizes are being used behind the scenes?


There are all sorts of possible buffers. Disk, OS, library.

Only concern however for that is speed. You can profile it. You can also use a OS command shell call for comparison.

If it matters, at least in my experience, OS shell commands will always be faster. This is especially true when copying directories. Seems reasonable given that the copy operation in the OS doesn't involve loading the data into the application.

Even so if you need it to be 'fast' for some reason then I would suggest that you need to change your requirements/design. Copying files, in general, is always 'slow'. Speed doesn't matter for single small files. So only matters for very large files and/or large numbers of files. But those will always be 'slow'. And there can be error conditions that make it even slower (which your code does not account for.) So attempting to guarantee a speed rate is never going to work.
Questionprintf without stdio.h Pin
mike74115-Dec-23 6:21
mike74115-Dec-23 6:21 
AnswerRe: printf without stdio.h Pin
Mircea Neacsu5-Dec-23 6:31
Mircea Neacsu5-Dec-23 6:31 
GeneralRe: printf without stdio.h Pin
mike74115-Dec-23 17:23
mike74115-Dec-23 17:23 
GeneralRe: printf without stdio.h Pin
Mircea Neacsu5-Dec-23 17:42
Mircea Neacsu5-Dec-23 17:42 
AnswerRe: printf without stdio.h Pin
Victor Nijegorodov5-Dec-23 6:32
Victor Nijegorodov5-Dec-23 6:32 
AnswerRe: printf without stdio.h Pin
k50545-Dec-23 7:02
mvek50545-Dec-23 7:02 
GeneralRe: printf without stdio.h Pin
jschell6-Dec-23 8:07
jschell6-Dec-23 8:07 
Questioncopying a file Pin
mike74115-Dec-23 4:24
mike74115-Dec-23 4:24 
AnswerRe: copying a file Pin
Mircea Neacsu5-Dec-23 4:32
Mircea Neacsu5-Dec-23 4:32 
AnswerRe: copying a file Pin
Richard MacCutchan5-Dec-23 5:05
mveRichard MacCutchan5-Dec-23 5:05 
AnswerRe: copying a file Pin
k50545-Dec-23 5:42
mvek50545-Dec-23 5:42 
QuestionMyth of a Myth? Pin
jschell4-Dec-23 4:38
jschell4-Dec-23 4:38 
AnswerRe: Myth of a Myth? Pin
Richard MacCutchan4-Dec-23 5:57
mveRichard MacCutchan4-Dec-23 5:57 
AnswerRe: Myth of a Myth? Pin
Mircea Neacsu4-Dec-23 6:05
Mircea Neacsu4-Dec-23 6:05 
GeneralRe: Myth of a Myth? Pin
harold aptroot6-Dec-23 20:55
harold aptroot6-Dec-23 20:55 
Questionhow to add another primary menu - C + in Qt Pin
Salvatore Terress1-Dec-23 7:34
Salvatore Terress1-Dec-23 7:34 
AnswerRe: how to add another primary menu - C + in Qt Pin
Andre Oosthuizen1-Dec-23 23:18
mveAndre Oosthuizen1-Dec-23 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.