-----Messaggio Originale-----
Da: "Przemyslaw Czerpak" <dru...@acn.waw.pl>
A: "Harbour Project Main Developer List." <harbour@harbour-project.org>
Data invio: venerdì 6 febbraio 2009 11.46
Oggetto: Re: [Harbour] curdir() and cross platform compatibility
Thank you for test.
BTW why leading dot (.) in missing in logical results?
Typo or some other problem?
Ops! A copy/paste problem, sorry:
E:\HARBOUR
T.
T.
T.
C:\
But it also says:
,----------------------------------------------------------------------------
| Note Although each process can have only one current directory, if the
| application switches volumes using the SetCurrentDirectory
function,
| the system remembers the last current path for each volume (drive
| letter). This behavior will manifest itself only when specifying a
| drive letter without a fully qualified path when changing the
current
| directory point of reference to a different volume. This applies
to
| either Get or Set operations.
`----------------------------------------------------------------------------
So were is the true ;-)
Who knows? :-)
Can you repeat your test without using any [x]Harbour functions like
CurDrive() or CurDir() but the following GetCurrentDirectory() instead:
HB_FUNC( GETCURRENTDIRECTORY )
{
char szPath[ MAX_PATH ];
if( GetCurrentDirectory( MAX_PATH, szPath ) )
hb_retc( szPath );
}
FUNCTION MAIN()
LOCAL cCurDir := GETCURRENTDIRECTORY()
? cCurDir
? SETCURRENTDIRECTORY( "C:\WINDOWS" )
? SETCURRENTDIRECTORY( cCurDir )
? SETCURRENTDIRECTORY( "C:" )
? GETCURRENTDIRECTORY()
INKEY( 0 )
RETURN NIL
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( SETCURRENTDIRECTORY )
{
hb_retl( SetCurrentDirectory( hb_parc( 1 ) ) );
}
HB_FUNC( GETCURRENTDIRECTORY )
{
char szPath[ MAX_PATH ];
if( GetCurrentDirectory( MAX_PATH, szPath ) )
hb_retc( szPath );
}
#pragma ENDDUMP
Same result:
E:\HARBOUR
T.
T.
T.
C:\
EMG
--
EMAG Software Homepage: http://www.emagsoftware.it
The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum
The Best of Spectrum Games: http://www.emagsoftware.it/tbosg
The EMG Music page: http://www.emagsoftware.it/emgmusic
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour