diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 09a16d5651..a80db3f9cd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +20000312-04:55 EST Paul Tucker + * source/rtl/dir.c + use _chmod( f,0 ) to get attribs. + 20000312-03:40 GMT+1 Victor Szakats * include/hbdefs.h include/hbinit.h diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index 01363d95c3..a97a3d24b6 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -40,6 +40,7 @@ /* * ChangeLog: * + * 1.66 20000312 ptucker Borland use _chmod for attribs * 1.53 19990917 dholm Moved normal hb_itemReturn() and ...Release() * calls out of the MSC, IBM & MingW32 #if block. * 1.49 19990915 dholm Added __MINGW32__ support @@ -223,6 +224,10 @@ static USHORT osToHarbourMask( USHORT usMask ) usRetMask = usMask; + /* probably access denied when requesting mode */ + if( usMask == (USHORT) -1 ) + return 0; + #if defined(OS_UNIX_COMPATIBLE) /* The use of any particular FA_ define here is meaningless */ /* they are essentially placeholders */ @@ -619,15 +624,20 @@ HARBOUR HB_DIRECTORY( void ) if( pos ) strcpy( filename, ++pos ); } - #elif defined(__BORLANDC__) - attrib = _rtl_chmod( fullfile, 0 ); + #elif defined(__BORLANDC__) + /* NOTE: _chmod( f, 0 ) => Get attribs + _chmod( f, 1, n ) => Set attribs + chmod() though, _will_ change the attributes + */ + attrib = (USHORT)_chmod( fullfile, 0,0 ); #elif defined(__DJGPP__) - attrib = _chmod( fullfile, 0 ); + attrib = (USHORT)_chmod( fullfile, 0 ); #else attrib = 0; #endif attrib = osToHarbourMask( attrib ); + if( attrib & FA_DIREC ) { /* MS says size for a Directory is undefined.