2007-11-02 18:52 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)

* harbour/source/common/hbfsapi.c
    ! fixed hb_fsFileExists() to return TRUE for files only
This commit is contained in:
Mindaugas Kavaliauskas
2007-11-02 16:57:00 +00:00
parent 804002c0b7
commit cfdacbcef1
2 changed files with 11 additions and 2 deletions

View File

@@ -8,6 +8,10 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-02 18:52 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/source/common/hbfsapi.c
! fixed hb_fsFileExists() to return TRUE for files only
2007-11-02 16:04 UTC+0100 Miguel Angel Marchuet Frutos <miguelangel@marchuet.net>
* contrib/bmdbfcdx/bmdbfcdx1.c
! fixed undoing previous fix

View File

@@ -299,13 +299,18 @@ HB_EXPORT BOOL hb_fsFileExists( const char * pszFileName )
}
#elif defined( HB_OS_WIN_32 )
{
return GetFileAttributesA( pszFileName ) != INVALID_FILE_ATTRIBUTES;
DWORD dwAttr;
dwAttr = GetFileAttributesA( pszFileName );
return ( dwAttr != INVALID_FILE_ATTRIBUTES ) &&
( dwAttr & ( FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE ) ) == 0;
}
#elif defined( HB_OS_UNIX )
{
struct stat statbuf;
return stat( pszFileName, &statbuf ) == 0;
return stat( pszFileName, &statbuf ) == 0 &&
( statbuf.st_mode & S_IFMT ) == S_IFREG;
}
#else
{