How to Copy Files in the main thread

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

How to Copy Files in the main thread

Post by MuhammadSohail »

Hi everyone,

in my Main thread , i want to copy some files from the Hard disk to the Temp folder . I am using _spawnlp command
_spawnlp( P_WAIT, "cmd", "cmd", "/c", "copy", from.c_str(), to.c_str(), NULL );

It is functioning properly but the problem is on the runtime it shows the Command window for a while which is not required.
Does anyone knows how to do this ???

thanks
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Check out the file commands. It is much easier to use the calls from wxWidgets for that, they will handle the platform independent issues for it.

http://www.wxwidgets.org/manuals/2.6.0/ ... wxcopyfile

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Thanks

Post by MuhammadSohail »

hi Jorgen,

I tried wxCopyFile , its functioning as i required.

Tnaks a lot
Post Reply