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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user