Isso é porque vc usa drive "mapeado" ?
Use como eu escrevi. O caminho completo file("c:\meudir\meuarq.dbf").
Porque vc "pode" está chamando o seu executável de outra pasta c:\meuexec\xyz.exe, ele não vai enxergar os arquivos mesmo.
Use os novos comandos do harbour.
hb_DirBase()
hb_FileExists()
hb_PathNormalize()
...
Checar aquivos via MAPEAMENTO é fria. (abrir/gravar/criar) use o letodb, ou estude as novas funções que existem no harbour que trabalham via sockets.
+ added PRG interface to Harbour FILE IO API
The following PRG functions are available for Harbour programmers:
HB_VFEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK>
HB_VFERASE( <cFileName> ) -> <nResult>
HB_VFRENAME( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_VFCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_VFDIREXISTS( <cDirName> ) -> <lExists>
HB_VFDIRMAKE( <cDirName> ) -> <nSuccess>
HB_VFDIRREMOVE( <cDirName> ) -> <nSuccess>
HB_VFDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory>
HB_VFDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace>
HB_VFATTRGET( <cFileName>, @<nAttr> ) -> <lOK>
HB_VFATTRSET( <cFileName>, <nAttr> ) -> <lOK>
HB_VFTIMEGET( <cFileName>, @<tsDateTime> ) -> <lOK>
HB_VFTIMESET( <cFileName>, <tsDateTime> ) -> <lOK>
HB_VFLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess>
HB_VFLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess>
HB_VFLINKREAD( <cFileName> ) -> <cDestFileName> | ""
HB_VFOPEN( <cFileName>, [ <nMode> ], [ <nAttr> ] ) -> <pHandle> | NIL
HB_VFCLOSE( <pHandle> ) -> <lOK>
HB_VFLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK>
HB_VFUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK>
HB_VFLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) ;
-> <nPID> | 0 (nolock) | -1 (err)
HB_VFREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) ;
-> <nRead>
HB_VFWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) ;
-> <nWritten>
HB_VFREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) ;
-> <nRead>
HB_VFWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) ;
-> <nWritten>
HB_VFSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset>
HB_VFTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK>
HB_VFSIZE( <pHandle> ) -> <nSize>
HB_VFEOF( <pHandle> ) -> <lEOF>
HB_VFFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL
HB_VFCOMMIT( <pHandle> ) -> NIL
HB_VFCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult>
HB_VFHANDLE( <pHandle> ) -> <nOsHandle>
HB_VFTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], ;
[ <nAttr> ] ) -> <pHandle> | NIL
Please remember that not all redirectors have to support all of them.
I.e. MEMIO allows to use directory names in files but does not allow to
create or remove directories. It also does not support file attributes
and times in current implementation though it can be easy added.
HB_VFCONFIG() is general function which can be used by redirector
authors to make some special operations which are specific to given
device.
HB_VFTEMPFILE() always creates temporary files on local system without
switching to FILE IO redirector. It's intentional behavior.
* src/rtl/fscopy.c
* used Harbour FILE IO API in hb_fsCopy()/HB_FCOPY()
Please remember that HB_FCOPY() always makes operation using current
system when HB_VFCOPY() may optimize it moving the operation to low
level subsystem or even other computer i.e. NETIO can do that when
both files are located on the same server.
* src/rdd/delim1.c
* src/rdd/sdf1.c
* src/rdd/dbf1.c
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/dbffpt/dbffpt1.c
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfntx/dbfntx1.c
* src/rdd/hsx/hsx.c
* open files with FXO_NOSEEKPOS attribute to inform low level API that
read/write filepos is not used (disables unnecessary filepos emulation).
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
+ added support for extended Harbour FILE IO API.
* contrib/hbnetio/utils/hbnetio/netiomgm.hb
! renamed "quit" command to "shutdown" as suggested by Rolf.
* contrib/hbnetio/utils/hbnetio/hbnetio.prg
* allow to interrupt server process using ESC when run in console window.
* contrib/hbmemio/memio.c
+ added support for extended Harbour FILE IO API.
I left two minor TODO notes - maybe someone will try to implement it.
Saudações,
Itamar M. Lins Jr.