Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Przemyslaw Czerpak
On Fri, 06 Feb 2009, Mindaugas Kavaliauskas wrote: Hi, [...] > Conclusion: no SetCurrentDirectoryW() is called at all. > GetCurrentDirectoryW() returned 6 bytes sting (i.e., "D:\PRG"). So command > result (C:\Documents and Settings\Administrator) is printed from cmd.exe > "cache". Thank you v

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Mindaugas Kavaliauskas
Hi, Perhaps we need to reverse engineer to understand how cd command works... :) It seems it is not based on SetCurrentDirectory() function. cmd.exe: Command: C:\Documents and Settings\Administrator>cd d:\prg API call: GetCurrentDirectoryW(DWORD:260, PWSTR:0x13f80c:"??") 0x4ad041f0

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Mindaugas Kavaliauskas
Hi, Sorry but I have to miss sth. Do you want to say that in this code: ... it does not work for you but works in the Mindaugas code? Mindaugas can you confirm it? The results is very strange for me also. I've changed a code a little, to indicate an errors and did much more tests. Also tried t

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Viktor Szakáts
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" ) ? SETCURRENTDIRECT

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Przemyslaw Czerpak" A: "Harbour Project Main Developer List." Data invio: venerdì 6 febbraio 2009 16.59 Oggetto: Re: [Harbour] curdir() and cross platform compatibility Sorry but I have to miss sth. Do you want to say that in this

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Przemyslaw Czerpak
On Fri, 06 Feb 2009, Enrico Maria Giordano wrote: Hi, >> I have different results (WinXP SP2)! SetCurrentDirectory("C:") correctly >> sets C drive and its current directory. > I confirm your result with *your* sample. Sorry but I have to miss sth. Do you want to say that in this code: FUNCTION

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Mindaugas Kavaliauskas" A: "Harbour Project Main Developer List." Data invio: venerdì 6 febbraio 2009 13.57 Oggetto: Re: [Harbour] curdir() and cross platform compatibility > Same result: > E:\HARBOUR > T. > T. > T. &g

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Mindaugas Kavaliauskas" A: "Harbour Project Main Developer List." Data invio: venerdì 6 febbraio 2009 13.55 Oggetto: Re: [Harbour] curdir() and cross platform compatibility I have different results (WinXP SP2)! SetCurrentDirectory(&qu

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Mindaugas Kavaliauskas
1. What windows version do you use. WinXP SP2 2. What will happen if you use SETCURRENTDIRECTORY( "C:.\" ) instead of SETCURRENTDIRECTORY( "C:" ) PROC main() TEST() RETURN #pragma BEGINDUMP #include "windows.h" HB_FUNC( TEST ) { char szPa

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Mindaugas Kavaliauskas
> Same result: > E:\HARBOUR > T. > T. > T. > C:\ The dot is missing again. But it was there when I pasted it. Perhaps a problem with Outlook Express and Unicode chars. Does Outlook "eats" also "WINDOWS" from "C:\WINDOWS" in last line? Regards, Mindaugas __

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Mindaugas Kavaliauskas
Hi, 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

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Przemyslaw Czerpak" A: "Harbour Project Main Developer List." Data invio: venerdì 6 febbraio 2009 12.09 Oggetto: Re: [Harbour] curdir() and cross platform compatibility > Same result: > E:\HARBOUR > T. > T. > T. >

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Przemyslaw Czerpak
On Fri, 06 Feb 2009, Enrico Maria Giordano wrote: > Same result: > E:\HARBOUR > T. > T. > T. > C:\ Thank you. Last two questions. 1. What windows version do you use. 2. What will happen if you use SETCURRENTDIRECTORY( "C:.\" ) instead of SETCURRENTDIRECTORY( "C:" ) best regards, Przemek __

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Przemyslaw Czerpak" A: "Harbour Project Main Developer List." 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 logi

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Przemyslaw Czerpak
On Fri, 06 Feb 2009, Enrico Maria Giordano wrote: Hi, > It seems not. The following sample: > FUNCTION MAIN() >LOCAL cCurDir := CURDRIVE() + ":\" + CURDIR() >? cCurDir >? SETCURRENTDIRECTORY( "C:\WINDOWS" ) >? SETCURRENTDIRECTORY( cCurDir ) >? SETCURRENTDIRECTORY( "C:" ) >

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Enrico Maria Giordano
-Messaggio Originale- Da: "Przemyslaw Czerpak" A: "Harbour Project Main Developer List." Data invio: venerdì 6 febbraio 2009 10.58 Oggetto: Re: [Harbour] curdir() and cross platform compatibility I have a questions for Windows users. Can we use SetCurrentD

Re: [Harbour] curdir() and cross platform compatibility

2009-02-06 Thread Przemyslaw Czerpak
On Fri, 06 Feb 2009, Mindaugas Kavaliauskas wrote: Hi, >> Question: what this code shows in windows if current directory is set >> to some //server/path/tree/file path? >>? curdrive()+hb_osPathSeparator()+curdir() > > C:\cawi32\sample\test>hbrun test14

Re: [Harbour] curdir() and cross platform compatibility

2009-02-05 Thread Barry Jackson
In Linux:- /home/baz/hash // current path in Linux ? curdrive()+hb_osPathSeparator()+curdir() Returns:- A/home/baz/hash If curdrive() returned "" in Linux then there may be compatibility? Where does "A" come from? Barry Jackson wrote: Sorry, my mistake - I did not test in Windows. I j

Re: [Harbour] curdir() and cross platform compatibility

2009-02-05 Thread Barry Jackson
Sorry, my mistake - I did not test in Windows. I just found my old Clipper code in which:- path_str = (DISKNAME())+":\"+(CURDIR()) Will test more in future! ;-) Mindaugas Kavaliauskas wrote: Hi, Question: what this code shows in windows if current directory is set to some //server/path/tree/

Re: [Harbour] curdir() and cross platform compatibility

2009-02-05 Thread Mindaugas Kavaliauskas
Hi, Question: what this code shows in windows if current directory is set to some //server/path/tree/file path? ? curdrive()+hb_osPathSeparator()+curdir() C:\cawi32\sample\test>hbrun test146.prg C\cawi32\sample\test \\\linux\samba1

Re: [Harbour] curdir() and cross platform compatibility

2009-02-05 Thread Przemyslaw Czerpak
On Thu, 05 Feb 2009, Barry Jackson wrote: Hi Barry. > In Linux the full path is returned with the leading "/" missing, which > breaks compatibility with Windows code. > Path = "/"+curdir() // Linux > Path = curdir() // Win Have you tested it? > Is it possible to correct this? In

[Harbour] curdir() and cross platform compatibility

2009-02-05 Thread Barry Jackson
In Linux the full path is returned with the leading "/" missing, which breaks compatibility with Windows code. Path = "/"+curdir() // Linux Path = curdir() // Win Is it possible to correct this? ___ Harbour mailing list Harbour@harbour-pr