Subj : Re: Copying Files To : borland.public.cpp.borlandcpp From : Arjan Date : Thu Jul 10 2003 04:10 pm When you are on Win32 I would prefer a Win3API call like BOOL CopyFile( LPCTSTR lpExistingFileName, // name of an existing file LPCTSTR lpNewFileName, // name of new file BOOL bFailIfExists // operation if file exists ); or the variant BOOL CopyFileEx( LPCTSTR lpExistingFileName, // name of existing file LPCTSTR lpNewFileName, // name of new file LPPROGRESS_ROUTINE lpProgressRoutine, // callback function LPVOID lpData, // callback parameter LPBOOL pbCancel, // cancel status DWORD dwCopyFlags // copy options ); and for moving: BOOL MoveFile( LPCTSTR lpExistingFileName, // file name LPCTSTR lpNewFileName // new file name ); or the variant: BOOL MoveFileEx( LPCTSTR lpExistingFileName, // file name LPCTSTR lpNewFileName, // new file name DWORD dwFlags // move options ); Consult thw msdn online for more info. Georges wrote: > The only way I know of copying files from one directory to another in C > or C++ > is to use the system command eg: > > system("xcopy C:\\THISDIR\\*.DAT C:\\THATDIR\\"); > > which is not very elegant as it displays a DOS window. > > Is there any other C/C++ function that would to the same job ? > > Georges > .