2007-11-07 10:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/common/hbfsapi.c
    ! fixed DJGPP builds
    * use _chmod() if available (for long file name support)
      or _dos_getfileattr() instead of direct interrupt calls
This commit is contained in:
Przemyslaw Czerpak
2007-11-07 09:48:22 +00:00
parent 8acd47d80c
commit c01cc32ee1
2 changed files with 23 additions and 21 deletions

View File

@@ -8,6 +8,12 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-07 10:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/common/hbfsapi.c
! fixed DJGPP builds
* use _chmod() if available (for long file name support)
or _dos_getfileattr() instead of direct interrupt calls
2007-11-07 01:47 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/filesys.c
* updated hb_fsTell() and hb_fsEof() to respect platform dependent

View File

@@ -54,13 +54,13 @@
#include "hbapi.h"
#include "hbapifs.h"
#include "hb_io.h"
#if defined( HB_OS_WIN_32 )
#if !defined( INVALID_FILE_ATTRIBUTES )
#define INVALID_FILE_ATTRIBUTES ( ( DWORD ) -1 )
#endif
#elif defined( HB_OS_UNIX )
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
@@ -291,16 +291,14 @@ HB_EXPORT BOOL hb_fsFileExists( const char * pszFileName )
#if defined( HB_OS_DOS )
{
union REGS regs;
struct SREGS sregs;
regs.HB_XREGS.ax = 0x4300;
regs.HB_XREGS.dx = FP_OFF( pszFileName );
sregs.ds = FP_SEG( pszFileName );
HB_DOS_INT86X( 0x21, &regs, &regs, &sregs );
fExist = regs.x.cflag == 0 && ( regs.HB_XREGS.cx & 10h ) == 0;
#if defined( __DJGPP__ ) || defined(__BORLANDC__)
int iAttr = _chmod( pszFileName, 0, 0 );
fExist = iAttr != -1 && ( iAttr & 0x10 ) == 0;
#else
unsigned int iAttr = 0;
fExist = _dos_getfileattr( pszFileName, &iAttr ) == 0 &&
( iAttr & 0x10 ) == 0;
#endif
}
#elif defined( HB_OS_WIN_32 )
{
@@ -347,16 +345,14 @@ HB_EXPORT BOOL hb_fsDirExists( const char * pszDirName )
#if defined( HB_OS_DOS )
{
union REGS regs;
struct SREGS sregs;
regs.HB_XREGS.ax = 0x4300;
regs.HB_XREGS.dx = FP_OFF( pszDirName );
sregs.ds = FP_SEG( pszDirName );
HB_DOS_INT86X( 0x21, &regs, &regs, &sregs );
fExist = regs.x.cflag == 0 && ( regs.HB_XREGS.cx & 10h );
#if defined( __DJGPP__ ) || defined(__BORLANDC__)
int iAttr = _chmod( pszDirName, 0, 0 );
fExist = iAttr != -1 && ( iAttr & 0x10 ) != 0;
#else
unsigned int iAttr = 0;
fExist = _dos_getfileattr( pszDirName, &iAttr ) == 0 &&
( iAttr & 0x10 ) != 0;
#endif
}
#elif defined( HB_OS_WIN_32 )
{