Antonio Linares wrote:Lorenzo,
Maybe you can first check if a file exists to force the wake up of the computer:
- Code: Select all Expand view
while ! File( "myfile.txt" )
SysRefresh()
end
Antonio,
thanks but this does not work!
It is not a problem of file not found or read error, the problem is coming from the fact that, when in suspension
the "static" ? reference to the index file is lost.
I got the same error even if i try to relink the index!
This is not a question about some wrong code logic of mine, is all about the way windows 8.1 manage
and restore the memory after suspension !!!
This error OCCURS ONLY in this occasion/situation !
and here the Harbour code that cause the ERROR 2155
- Code: Select all Expand view
/*
* check if index was updated by other process and if it was discard buffers
*/
static void hb_cdxIndexCheckVersion( LPCDXINDEX pIndex )
{
BYTE byBuf[8];
ULONG ulVer, ulFree;
if ( hb_fsSeek( pIndex->hFile, 0x04, FS_SET ) != 0x04 ||
hb_fsRead( pIndex->hFile, byBuf, 8 ) != 8 )
{
if ( pIndex->lockWrite > 0 && hb_fsSeek( pIndex->hFile, 0, FS_END ) == 0 )
memset( byBuf, 0, 8 );
else
hb_errInternal( 2155, "hb_cdxIndexCheckVersion: Read error on index heading page.", NULL, NULL );
}