diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6d8786569e..f221800e23 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,18 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-22 12:27 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/src/rtl/fscopy.c + * added runtime error for HB_FCOPY() bad param types only + * made a function HB_FCOPY() a pure file system function + does not dependent on _SET_DEFAULT setting + ; File open mode is not altered a avoid any influence on OS/2 + behaviour if source and destination files are the same (see + ChangeLog entry at 2009-11-24 16:57). I guess, hb_fsExpOpen() + still can be changed to hb_fsOpen() with FO_EXCLUSIVE, + FO_CREAT, and FO_TRUNC but I'm unable to test it, so, I leave + current code. + 2011-02-21 20:15 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fscopy.c * Reverted my recent changes. diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index 01ce6d0c98..a6a095f909 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -51,6 +51,7 @@ */ #include "hbapi.h" +#include "hbapierr.h" #include "hbapifs.h" #if defined( HB_OS_UNIX ) @@ -67,9 +68,9 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) HB_FHANDLE fhndSource; HB_FHANDLE fhndDest; - if( ( fhndSource = hb_fsExtOpen( pszSource, NULL, FO_READ | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) + if( ( fhndSource = hb_fsExtOpen( pszSource, NULL, FO_READ | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { - if( ( fhndDest = hb_fsExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) + if( ( fhndDest = hb_fsExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { #if defined( HB_OS_UNIX ) struct stat struFileInfo; @@ -132,8 +133,5 @@ HB_FUNC( HB_FCOPY ) if( pszSource && pszDest ) hb_retni( hb_fsCopy( pszSource, pszDest ) ? 0 : F_ERROR ); else - { - hb_fsSetFError( 2 /* file not found */ ); - hb_retni( F_ERROR ); - } + hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); }