[Harbour] curdir() and cross platform compatibility

Viktor Szakáts harbour.01 at syenar.hu
Fri Feb 6 11:57:36 EST 2009


Here are some more results when run in M:\tests_m, while the default dir on
C: was \tests_c:--
M:\tests_m
.T.
.T.
.T.
C:\tests_c
--

C code slightly changed for MSVC:
--
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( SetCurrentDirectoryA( ( LPCSTR ) hb_parc( 1 ) ) );
}
HB_FUNC( GETCURRENTDIRECTORY )
{
 char szPath[ MAX_PATH ];
 if( GetCurrentDirectoryA( MAX_PATH, ( LPSTR ) szPath ) )
    hb_retc( szPath );
}
#pragma ENDDUMP
--

Brgds,
Viktor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.harbour-project.org/pipermail/harbour/attachments/20090206/7476d62a/attachment.html


More information about the Harbour mailing list